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

Email auth factor #3602

Merged
merged 7 commits into from
Apr 23, 2024
Merged

Email auth factor #3602

merged 7 commits into from
Apr 23, 2024

Conversation

pfrazee
Copy link
Collaborator

@pfrazee pfrazee commented Apr 17, 2024

  • Add a setting for enabling email 2fa
  • Add prompt for 2fa code in login
  • Wire up to backend

To test:

  • Create a test account.
  • Go to settings. Enable 2FA. This will trigger email verification. Complete verification and it will be enabled.
  • Log out. Log back in. You will be prompted to provide the code.
  • Go to settings. Disable 2FA. This will email a confirmation code. Enter the code and it will be disabled.
  • Log out. Log back in. Code no longer required.

Video

CleanShot.2024-04-18.at.11.20.52.mp4

Copy link

render bot commented Apr 17, 2024

Copy link

github-actions bot commented Apr 17, 2024

Old size New size Diff
6.44 MB 6.45 MB 6.97 KB (0.11%)

Copy link

github-actions bot commented Apr 18, 2024

The Pull Request introduced fingerprint changes against the base commit: cbb817b

Fingerprint diff
[{"type":"file","filePath":"package.json","reasons":["expoConfigPlugins"],"hash":"6d32c9262c6f1b69d4dbb4781a15ed5a51372388"}]

Generated by PR labeler 🤖

@pfrazee pfrazee changed the title Email auth factor [WIP] Email auth factor Apr 18, 2024
@pfrazee pfrazee marked this pull request as ready for review April 18, 2024 18:25
Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

lg, seems to work!

},
'LoginForm',
)
} catch (e: any) {
const errMsg = e.toString()
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
setIsProcessing(false)
if (errMsg.includes('Authentication Required')) {
if (
e instanceof ComAtprotoServerCreateSession.AuthFactorTokenRequiredError
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note instanceof doesn't work across iframes so it would be nice not to rely on this as the recommended way to check it

{stage === Stages.ConfirmCode ? (
<Trans>
An email has been sent to{' '}
{currentAccount?.email || '(no email)'}. It includes a
Copy link
Collaborator

@gaearon gaearon Apr 19, 2024

Choose a reason for hiding this comment

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

Is this (no email) some sort of a corner case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah that really shouldnt be possible

src/screens/Login/LoginForm.tsx Show resolved Hide resolved
src/screens/Login/LoginForm.tsx Outdated Show resolved Hide resolved
@pfrazee pfrazee merged commit 710e913 into main Apr 23, 2024
6 checks passed
@pfrazee pfrazee deleted the paul/email-auth-factor branch April 23, 2024 02:18
estrattonbailey added a commit that referenced this pull request Apr 23, 2024
* origin/main: (47 commits)
  Add option to remove quoted post in composer (#3670)
  Add border radius to GIF loading state (#3669)
  use mp4 over webm (#3666)
  Release 1.79 (#3661)
  Update Japanese translation (#3656)
  [Statsig] Add test gates and events (#3659)
  Quick fix to ensure disable 2fa dialog adjusts to keyboard (#3658)
  Email auth factor (#3602)
  GIF Viewer (#3605)
  Ungate profile scroll fix (#3655)
  rm country param (#3653)
  [GIFs] Remove consent flow (#3652)
  [GIFs] Replace GIPHY with Tenor (#3651)
  properly close the switch account dialog (#3558)
  [GIFs] Reset scroll on query change (#3642)
  Update French translations (#3644)
  [GIFs] Add error boundary to GIF picker (#3643)
  Revert "Add layout transitions to the composer photo gallery on iOS (#3609)" (#3649)
  Update Finnish translations  (#3630)
  Update Japanese translations (#3632)
  ...
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