Reset Password | Login & Register Android App Using Firebase | Part 3/4

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys and because from a small Academy and in this field today we are going to exchange our Authenticator app that we created previously where I have shown you guys how to create authentication system using email there we learn about creating a login page register page and we also we also take the data from the user like profile data and we store that in the firebase and we also learn how to retrieve that data so in this far today I'm going to extend the Authenticator app in that video I left that how to reset the password so in this video I'm going to show you guys how to reset the password if user forget the his password okay so it's really easy in firebase to reset the password so whenever user click on forgot password he can give his email and if that email exist in our firebase authentication list then firebase will send him a email and with link and using that link user can reset the password so it is just a pretty standard way of resetting the password and after that he can log into the our application so without further ado let's get into our applications and also if you don't have the source code I have put the link in the description you can download that from there and if you want to learn how to create that whole applications then you can check the playlist that I am going to put in the description as well and there is one more authentication tutorials on OTP so if you want to register the user without using email but using the his phone number and OTP receive through his number then you can shake that tutorials as well so let's start with these tutorials today so I have this application open here so click on this I'm going to open my application the application is open now I'm going to go to the layout section of this application and in the layout section we have these three layouts here for a main activity register activity and login activity so let me go to the login activity and I wanna show the forged password option here because whenever user comes to the login page and if we already have the account and don't him but the pod don't remember the password then he can change the passport from here right so it is they pretty a common way of displaying the reset password option so I'm going to drag and drop one text view here and just between this progress bar and it takes you that we have here so let me save the constraint okay so make this little bit bold and I will change the text as forgot pass for okay I'm gonna give the ID for this so that we can use this later forward password okay now let me change the color of this so that it can it will address with the UI here okay so this is the option where user can click on this forget password I am go to do and it will display the password reset activity so let's come back to our login activity here so whenever user is clicking clicking on that law forged password takes view we are going to let them enter the email and firebase will say in the reset link to their email address if that email address is valid and present in our authentication list okay let me get that pocket password link here so for that I need to create a text view first so we do have text view here already so I'm just going to do create another one here so forward X link and I'm gonna initialize this variable with the XML resources that we have that we just created in our layout so our @ ID done and I'm gonna use the forward pass for text view now I need to handle the on click on this link because whenever user click on that we are going to do some operations right so I'm gonna create the set on click listener here on our fog advise for text link so I'm gonna set on click listener and new on click listener and inside the on click method we can write our code that will handle the reset off sense of it inside this on click view we need a edit X but edit text field so that the user can enter his email so to do that I'm going to create an Eric field here so I'm gonna say it the name as reset male and I'll be creating a new added text field and I'm gonna get the context of current view so I'm gonna use waiter to get context okay now I'm gonna integrate these reset it a detects inside my dialog so I'm first I I'll be creating an error dialog so let me create that LR dialog dot builder and I will say password reset dialog new inner dialogue builder and I'm gonna get the current context now inside the cellar dialog I can say the title and messages so that user will understand that what he needs to do further to reset his password so I can use password reset dialog dots a title to give the site to save the title of the dialog so I'm gonna say it reset and after that I can use the same object to set the messages so that user will see the messages okay and I'm gonna give the information that says enter your email to reset the password link okay to receive the password reset link now I'm gonna save my edit text to the error dialog by using this site view so I can use password to say dialog dot sight view and I'm gonna say the receive mail view now finally I will handle the click button on the alert dialog so our error Dalek will have two options yes or no so if user click on no will this exit the alert dialog and user go to the login screen if user click on yes we will handle that and say take the email from the edit text and say in theory state email so I'm gonna use the same object a low dialog object and I'm gonna use first set positive button and first we need to provide the text further button so yes and we need to handle the click on this positive button so so new dialog interface dot click on click listener inside this owl extract the email and send reset link okay we'll do that later first let me also save the negative button that is for no option okay so say it negative button and we'll do nothing because if user click on no he'll be he'll be redirected back to the our login view closing dialog okay now inside these I'm going to send the reset link to the user now to reset the password we need the instance of firebase auth so let me create an instance for firebase authentication and we already have firebase authentication here so I'm gonna initialize that but I yes we already have this fire which authentication here and we have already initialized that as well so I can use this same firebase authentication object to say in the password so let me go back here and after that now to reset the password I need email as I said before right so first I'm gonna extract the email from the edit text field so I'm gonna set mail and the name of our edit text field is reset mail and we can use gate text and I'm gonna convert that to the string now I'll use the ephod and we have one method called same password reset email here okay and I'm gonna pass the email here now I can listen for the success or failure of these this method okay if the same password reset email is is able to say in the reset link successfully then it will call the on success listener otherwise it will call the on failure listener so I'm gonna use the add-on success listener so that we can display some message to the user that says reset link has been sent and we'll close the dialog okay so let me create a toast okay so otherwise if the operation is failed then we'll display some other messes so let me and on failure listener and on failure listener inside these who will display some message to the user that says Ling is not sent and I'm gonna attach the exception okay so whatever the exception user is getting so if he is not giving the valid email or if he is not providing the email that is that have the account on our application and in that case this exception will be called and he'll get the messages from our applications so guys this is how we say in the reset email to the user so I'm gonna run this app and show you guys how exactly this work and I also show you how to customize the the template that is that will be sent to the user so that you can you know make it more feel like it is about your applications so there is some modification you need to make there as well so let's go ahead and do that okay guys is the app is running now and I'm gonna create an account and I'm gonna show you by resetting the email okay for that account so to create the email ie I need to provide all these information here okay I'm gonna say it some password 1 2 3 4 5 6 and let me give some sample phone number and now I'm going to register here and we'll see how it goes ok the user is created and you can see my profile here provides details this is how we had implemented this application before in other tutorial so if you want that you can check that two drills in the I will link that video on the description ok so as you as you see the my email is the my small Academy at the Red Sea Malcolm so I'm gonna log out from you and here in the login screen I have now forgot password but before actually doing that let me go here and I just remember that I forgot to display the other dialog so let me display that I'll create the dialog and so now let me rerun this app again and I'll also open the firebase console so that you can see the friends now select the applications so this is called Authenticator app and here my application is connected to this firebase particular project so I'm gonna go to authentication and show you guys that my list of email address okay so this is the email that I used to create the account here okay our app is running now here okay I'm gonna go to the login and I'm gonna click on forgot password and it will display this interviewer mail to receive the receipt link and if I click on no it will just close this so let me give my email okay so this is the mail that I used so let me click on yes and we'll what for wait for the message and it says recently link is into your email and now I'm gonna go to my gmail account and so you guys the mail is received or not so let me go here and okay here you can see reset your password for project something it says project because we have not customized our template yet so let me click on that and now I have this reset email and it says project five six two seven four three because this is the actual name of our project here so that's why it is saying that it's okay we can customize that later and click on this link and it will let you reset your account so from here I can give the new password so I'm gonna give some new password okay click on save and to reset the password for me yes now I'm gonna go back here and type my email and the new password so here I have typed my email that is exactly mail that I used and I'm going to use the password that I just typed that is nine eight seven six five four three two one that is my new password now click and log in and it should log me into the okay guys so this is how we received the password in firebase I hope that you understood that what I I was trying to show you in this video that how we received the password in firebase but if you are getting some problem to run the applications and so on then there are various ways that you can contact with me one is obviously the you to comment section other other options is that you can join our Facebook group I'll link that on the description and also I will write a blog post about this so you can go there and comment there I will reply your comment there a lot of other firebase related videos are coming so if you haven't subscribed yet don't forget to subscribe ring the bell like the videos and I hope to see you in my next video bye bye [Music] you
Info
Channel: SmallAcademy
Views: 51,265
Rating: undefined out of 5
Keywords: firebase phone authentication android tutorial, firebase android authentication tutorial, android studio tutorial - firebase authentication (2019 version), #1 firebase phone authentication android tutorial - sign in, Login & Register Using Firebase, Android Studio Authentication Tutorials, login and register android studio firebase, firebase authentication android, firebase authentication tutorial, reset firebase password, firebase reset email, firebase authentication reset password
Id: UMNeeMSUZl0
Channel Id: undefined
Length: 13min 52sec (832 seconds)
Published: Fri Jan 10 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.