An atproto PDS written in Go

Implement 2FA (email) #3

merged
opened by willdot.net targeting main from willdot.net/cocoon: email-auth-factor

This implements 2FA (email only at the moment).

I have run this on my test account and tested various flows:

  • Turning 2FA on and off through the Bluesky app
  • Turning 2FA on and the updating my email address to a new one, and observing that 2FA is disabled
  • Logging in with 2FA enabled
  • Using a 3rd party app (tangled) to log into my account via OAuth and being able to provide the 2FA token (including providing the wrong password and token as well to ensure that when the correct password and token is provided, the flow continues as normal)
  • Logging into my PDS directly via the /account/login route with 2FA turned on
  • Create a new account and observing that the two_factor_type is preset to none

The UI for the the PDS /account/login screen is far from perfect and could use some improvements. For example once you're entered the handle and password, the page refreshes with the new token input, but the handle and password fields are now empty :(

0
by willdot.net 3 comments
expand 5 commits
implement enabling / disabling email auth factor (not currently checked on auth checks though)
implement 2fa on creating a session
refactor the 2FA code into it's own field on model and generate a new email type
implement providing 2FA token on PDS account login screen
refactor so that there's a 2FA type on the repo which replaces EmailAuthFactor

i can deal with the merge conflict, that just poor timing haha

Ha! Huge panic looking at all those conflict files but huge relief to see it鈥檚 only logging changes. Should be easy to sort out, I鈥檒l do it in the morning.

cool thank you! yea it should be very easy to clean up i think...i'd do it myself but actually not sure what the best way to do it with tangled is (on github i could usually just push right to your pr, idt i can do that here)

sign up or login to add to the discussion
1
by willdot.net 0 comments
expand 6 commits
implement enabling / disabling email auth factor (not currently checked on auth checks though)
implement 2fa on creating a session
refactor the 2FA code into it's own field on model and generate a new email type
implement providing 2FA token on PDS account login screen
refactor so that there's a 2FA type on the repo which replaces EmailAuthFactor
another merge conflict
sign up or login to add to the discussion
2
by willdot.net 2 comments
expand 5 commits
implement enabling / disabling email auth factor (not currently checked on auth checks though)
implement 2fa on creating a session
refactor the 2FA code into it's own field on model and generate a new email type
implement providing 2FA token on PDS account login screen
refactor so that there's a 2FA type on the repo which replaces EmailAuthFactor

Merge conflicts solved.

thank you!! woo! i might try to build on top of this and get at least oath working, maybe just totp for now

pull request successfully merged
sign up or login to add to the discussion
Labels

None yet.

Participants 2
AT URI
at://did:plc:dadhhalkfcq3gucaq25hjqon/sh.tangled.repo.pull/3mbho3gx4yz22