Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,21 @@ func RegisterAuthAPIs(requireAuth bool, targetMux *http.ServeMux) {
authAgent.UnregisterUser(username)
authAgent.CreateUserAccount(username, newPassword, "")
})

// TOTP 2FA Endpoints
targetMux.HandleFunc("/api/auth/totp/status", authAgent.HandleTOTPStatus)
targetMux.HandleFunc("/api/auth/totp/generate", authAgent.HandleTOTPGenerate)
targetMux.HandleFunc("/api/auth/totp/verify", authAgent.HandleTOTPVerify)
targetMux.HandleFunc("/api/auth/totp/disable", authAgent.HandleTOTPDisable)
targetMux.HandleFunc("/api/auth/totp/verify-code", authAgent.HandleTOTPVerifyCode)

// WebAuthn (Passkey) Endpoints
targetMux.HandleFunc("/api/auth/webauthn/register/begin", authAgent.HandleWebAuthnRegisterBegin)
targetMux.HandleFunc("/api/auth/webauthn/register/complete", authAgent.HandleWebAuthnRegisterComplete)
targetMux.HandleFunc("/api/auth/webauthn/list", authAgent.HandleWebAuthnList)
targetMux.HandleFunc("/api/auth/webauthn/remove", authAgent.HandleWebAuthnRemove)
targetMux.HandleFunc("/api/auth/webauthn/auth/begin", authAgent.HandleWebAuthnAuthBegin)
targetMux.HandleFunc("/api/auth/webauthn/auth/complete", authAgent.HandleWebAuthnAuthComplete)
}

/* Register all the APIs */
Expand Down
Loading