refactor authentication
fixing test
exercise goal completed except for failing test