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

Align OAuth 2FA code handling with social-app #2825

Merged
merged 5 commits into from
Sep 23, 2024
Merged

Conversation

mozzius
Copy link
Member

@mozzius mozzius commented Sep 23, 2024

Fixes bluesky-social/social-app#5448

The email OTP code we send is in lowercase for some reason - I'll try and fix that as well, but in social-app it tries some basic corrections on the code in case someone types it by hand. This PR uses the same function that social-app uses, which uppercases it and adds the dash in the middle if it's not present.

Note

social-app uses the regex /^[A-Z2-7]{5}-[A-Z2-7]{5}$/, whereas I found oauth was using the slightly more lax /^[A-Z0-9]{5}-[A-Z0-9]{5}$/. I replaced it with social-app's one, I hope that's ok?

@damiensedgwick
Copy link

Just so you know, for most browsers this would usually have been fine but this appears to be a very long standing Webkit bug!

@mozzius
Copy link
Member Author

mozzius commented Sep 23, 2024

Oh huh, I didn't realise!

Co-authored-by: surfdude29 <[email protected]>
@mozzius mozzius merged commit d7e3767 into main Sep 23, 2024
1 check passed
@mozzius mozzius deleted the samuel/uppercase-email-2fa branch September 23, 2024 17:23
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.

2FA code received in email is formatted incorrectly.
4 participants