-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add option for quick connect logins #144
Conversation
I've never used flutter/dart, so please let me know if there are better patterns for anything I've done. This app seems great just can't currently log in with my normal accounts since I have OIDC set up. |
This change changes the login flow to first request the uri of the server, then the user selects login with password or quick connect. At that point, the existing password login flow takes over, or a new one that gets a quick connect code is used. As part of this change, the auth information stored by the system has been changed. Previously the password had been stored. This is probably not needed (at least basic usage shows it doesn't affect anything) since there's a refresh token there. Since both login flows provide a refresh token, we can store that instead.
12fc38e
to
61d80c4
Compare
Great work. I didn't get to implementing Quick Connect yet. |
lib/screens/login_messages.dart
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put the functions in a class and the file in the components folder.
The error messages should be localized too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can move the message to be localized, but I didn't write that part (I'm just refactoring to be able to use it in the quick connect flow). It's marked as "//todo PLACEHOLDER MESSAGES NOT FINAL". Thoughts?
@@ -68,6 +68,89 @@ class ApiService { | |||
return _user!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Login with Password still returns the password which will be saved too.
What I didn't check is, if the user gets redirected to the login after the token has expired.
And the token doesn't get to be refreshed yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted the change that just reconnects with the token to call the login if there is a password.
If the token has expired (not sure when/how that happens as it appears to be an opaque blob and not a jwt), it bubbles up as a 401 that will cause the app to error out and send you to the login
Co-authored-by: Jonathan <[email protected]>
@jdk-21 anything else you need here? Any chance it come be merged and released so I can use this with deployment? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking this long to respond.
Thank you for your contribution.
This change reworks the login flow to first request the uri of the server, then the user selects login with password or quick connect. At that point, the existing password login flow takes over, or a new one that gets a quick connect code is used.
Server URL
Password
Quick connect (connecting)
Quick connect
As part of this change, the auth information stored by the system has been changed. Previously the password had been stored. This is probably not needed (at least basic usage shows it doesn't affect anything) since there's a refresh token there. Since both login flows provide a refresh token, we can store that instead.