-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Email Login and Logout #101
Comments
I can give it a try! |
Cool @keyurgit45, please can try to implement auth provider if you can. |
I can use firebase.instance.authstatechanged . for that we can create a new class to manage these things ? |
Okay @keyurgit45, also make sure to check the expiry time for logging in (Like if a user opens the app after 1 week, then he'll again have to log in). And remove the Wrapper Constructor if you're not using the key somewhere else |
@Mohitmadhav I have made the changes. Log in and log out are working fine. also in the sign-in method, I added the makeUserDataFromAuthUser() method which I forgot to add in prev PR. the issue #106 is due to this. I am really sorry for that. but I haven't implemented that expiry time for logging because I don't know how to implement that. Should I make a PR? |
For the expiry time for logging in feature, can we store the time each time when a user opens the app in shared pref and checks if it is been a 1 week or not if yes then it will log out else the user will be on the home screen? |
In general how long does the user can stay logged in (1 hr) if he doesn't open the app for a few days, which I don't know? No , don't use shared preferences, I have already setup Flutter Secure Storage Package , have a look at that |
official docs : Firebase Authentication sessions are long lived. Every time a user signs in, the user credentials are sent to the Firebase Authentication backend and exchanged for a Firebase ID token (a JWT) and refresh token. Firebase ID tokens are short lived and last for an hour; the refresh token can be used to retrieve new ID tokens. Refresh tokens expire only when one of the following occurs: The user is deleted also take a look at my previous comment also. |
Yeah, I read that too, and also your previous comment. See lib\utils\keys_storage.dart |
I have written this code, when should we call writeCurrentSessionTime() ? @Mohitmadhav |
@keyurgit45 it's better to call writeCurrentSesionTime() when the user logs in . |
means you want, the user should sign-in in every 2 days? @Mohitmadhav |
Actually, if the user does not open the app for more than 2 days, then he should sign in again. |
ok got it |
I can assign #106 to you and then you can create another PR for those missing changes. |
@Mohitmadhav Okay...firstly I will make PR for login and logout and then for issue #106 |
after doing git pull upstream main, I am getting this. I need onAuthStateChanged method, what to do here? @Mohitmadhav |
can you show the complete screenshot once? |
Ok cool, accept the incoming changes then. |
Description
To implement Email Login in the Initial Screen. Currently, it's resulting in null uid as shown below.
Screenshots
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Additional data
None
The text was updated successfully, but these errors were encountered: