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

Reset multi_auth to initial state on error #2007

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ekzyis
Copy link
Member

@ekzyis ekzyis commented Mar 22, 2025

Description

Based on #1998

Instead of just removing all multi_auth cookies on error, we now reset to the initial state.

Checklist

Are your changes backwards compatible? Please answer below:

yes

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:

7. Tested by removing each multi_auth cookie and seeing it getting set again.

2025-03-21.20-40-01.mp4

For frontend changes: Tested on mobile, light and dark mode? Please answer below:

n/a

Did you introduce any new environment variables? If so, call them out explicitly here:

no

@ekzyis ekzyis added the auth label Mar 22, 2025
@ekzyis ekzyis marked this pull request as draft March 22, 2025 01:07
@ekzyis ekzyis mentioned this pull request Mar 22, 2025
1 task
@ekzyis ekzyis marked this pull request as ready for review March 22, 2025 01:41
@ekzyis ekzyis requested a review from huumn March 22, 2025 01:41
@huumn
Copy link
Member

huumn commented Mar 22, 2025

Works well. Only, I see weird behavior when reseting cookies as anon. See video

Screen.Recording.2025-03-22.at.5.24.23.PM.mov

@ekzyis ekzyis marked this pull request as draft March 22, 2025 23:02
@ekzyis
Copy link
Member Author

ekzyis commented Mar 23, 2025

Ah, this happens because my code to know which account is currently selected sucks. It assumes that the cookie pointer is only updated by the client.

I think I'll create a useCookie function which detects cookie changes and returns updated cookies in a React-y way instead of what I am currently doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants