Skip to content
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

0.19 account reauth #793

Merged
merged 2 commits into from
Dec 4, 2023
Merged

0.19 account reauth #793

merged 2 commits into from
Dec 4, 2023

Conversation

EricBAndrews
Copy link
Member

Checklist

  • I have read CONTRIBUTING.md
  • I have described what this PR contains
  • This PR addresses one or more open issues that were assigned to me:
    - Slack
  • If this PR alters the UI, I have attached pictures/videos

Pull Request Information

This PR adds some logic to prompt users to reauthenticate if their saved credentials are invalid, namely:

  • invalidSession errors are now thrown for any credential failure response
    • AddSavedInstanceView now catches those as login failures instead of manually checking for .isIncorrectLogin on a response error
  • The expired session notification sheet is now attached normally to ContentView instead of being programmatically presented through the NotificationDisplayer
  • The expired session notification sheet now resets the invalidSession flag on the ErrorHandler when dismissed, which prevents an invalid session message being erroneously displayed when cancelling the token refresh and switching accounts

Testing steps

To simulate the use case of users attempting to use accounts saved in Mlem before their instance updated to 0.19, perform the following:

  • Run a local Lemmy instance on a 0.18 stable release build
  • Create some accounts and add them to Mlem
  • Update the local instance to 0.19
  • Relaunch Mlem

The new flow should trigger.

For thoroughness, I have tested both the cases where the accounts were added in an older version of Mlem (release-1.1) and the latest TestFlight build (beta-1.1.1-RC-2), though that shouldn't matter.

@EricBAndrews EricBAndrews requested a review from a team as a code owner December 4, 2023 06:58
@EricBAndrews EricBAndrews requested review from WestonHanners and JakeShirley and removed request for a team December 4, 2023 06:58
@EricBAndrews EricBAndrews enabled auto-merge (squash) December 4, 2023 07:11
Copy link
Member

@Sjmarf Sjmarf left a comment

Choose a reason for hiding this comment

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

Looks good! Does this close #791?

@EricBAndrews EricBAndrews merged commit e5dbbda into dev Dec 4, 2023
4 checks passed
@EricBAndrews EricBAndrews deleted the eric/0.19-account-reauth-2 branch December 4, 2023 20:22
@EricBAndrews
Copy link
Member Author

It does! Nice spot

@EricBAndrews EricBAndrews restored the eric/0.19-account-reauth-2 branch December 4, 2023 20:30
@EricBAndrews EricBAndrews deleted the eric/0.19-account-reauth-2 branch December 4, 2023 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants