KartaWeb.LocalLoginController (Karta v1.0.0)

Local login: an address and a password, then a TOTP code. Off unless config :karta, :local_login, true (KARTA_LOCAL_LOGIN=true); while it is off its routes answer 404 and the sign-in page has no form.

  • POST /login checks the password (Karta.Accounts.authenticate_password/3). Every failure gets the same page with the same words, whether or not the account exists; too many attempts get "too many attempts". The user who gave the right password is remembered in the session for five minutes, waiting for the code.
  • GET /login/totp asks for the code; a user without TOTP first gets a new secret to add to an authenticator app (kept in the session until a code for it is given).
  • POST /login/totp checks the code (or enrols the secret) and signs the user in (KartaWeb.UserAuth.log_in/3, a new session).

Summary

Functions

create(conn, arg2)

totp(conn, params)

verify_totp(conn, params)