back interdiff of round #2 and #1

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 :(

ERROR
models/models.go

Failed to calculate interdiff for this file.

ERROR
server/handle_account_signin.go

Failed to calculate interdiff for this file.

ERROR
server/handle_server_create_session.go

Failed to calculate interdiff for this file.

ERROR
server/handle_server_get_session.go

Failed to calculate interdiff for this file.

ERROR
server/handle_server_update_email.go

Failed to calculate interdiff for this file.

ERROR
server/mail.go

Failed to calculate interdiff for this file.

ERROR
server/templates/signin.html

Failed to calculate interdiff for this file.