Skip to content

Show stored username in General preference pane even when we don't have a valid session #87

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

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

interstateone
Copy link
Contributor

This reverts the change from 90c0679 (in #45) so that the username is shown in situations where we don't have a valid session but could almost certainly get one. Instead, to achieve what that commit was trying to do (not appear signed in when auth failed), we'll instead remove the username from UserDefaults if auth fails with an invalid username or password error. I think this will more closely match what users expect in this UI.

I've added a comment in the UI explaining why it is the way it is. It might also be worth considering renaming AuthenticationState or its cases to better reflect that it's probably more about the (short-lived) session state than whether the user has signed in before and has stored their credentials.

Testing

  • Run the app on main

  • Sign in in Preferences > General

  • Re-run the app

  • Open Preferences > General and see that it appears as if you're not signed in

  • Run the app on this branch

  • Sign in in Preferences > General

  • Re-run the app

  • Open Preferences > General and see that it appears as if you are signed in

  • Verify that auth still works by installing an Xcode or refreshing data while using the Apple data source. In either case you should at most be prompted to enter a 2FA code, and it shouldn't fail with an auth error.

This reverts the change from 90c0679 so that the username is shown in situations where we don't have a valid session but could almost certainly get one. Instead, to achieve what that commit was trying to do, we'll instead remove the username from UserDefaults if auth fails with an invalid username or password error. I think this will more closely match what users expect in this UI.

I've added a comment in the UI explaining why it is the way it is. It might also be worth considering renaming AuthenticationState or its cases to better reflect that it's probably more about the (short-lived) session state than whether the user has signed in before and has stored their credentials.
@interstateone interstateone added the enhancement New feature or request label Jan 26, 2021
Copy link
Contributor

@MattKiazyk MattKiazyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@interstateone interstateone merged commit 352816f into main Jan 26, 2021
@interstateone interstateone deleted the auth-pref-ui-change branch January 26, 2021 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants