Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAndrew Souza
70 PointsHow to add login with username, password and email
How would I go about adding login authentication with email and password on top of the username registration
2 Answers
Ben Jakuben
Treehouse TeacherTake a look at the Authentication section in the Firebase docs. There are ways to allow registering and logging in with different things, like this method: signInWithEmailAndPassword.
Andrew Souza
70 PointsHey Ben, I've been trying at adding user authentication for a while and I'm trying to add a logout button in an options menu but it seems that I need to make LoginActivity a fragment. How would I do that?
Ben Jakuben
Treehouse TeacherYou shouldn't have to use fragments...I'm guessing that's just their own example. You should be able to call signOut()
from the choice in your options menu using an example like this from the Firebase docs.
Once you call signOut() you may need to refresh or re-enter your Activity, though.