Feat/totp (#45)

* wip

* feat: finalize totp gen code

* refactor: split login screen and forms

* feat: add totp logic and ui

* refactor: make totp pending expiry time fixed

* refactor: skip all checks when disable continue is enabled

* fix: fix cli not exiting on invalid input
This commit is contained in:
Stavros
2025-03-09 18:39:25 +02:00
committed by GitHub
parent 47fff12bac
commit 5188089673
24 changed files with 862 additions and 270 deletions

View File

@@ -15,8 +15,9 @@ type LoginRequest struct {
// User is the struct for a user
type User struct {
Username string
Password string
Username string
Password string
TotpSecret string
}
// Users is a list of users
@@ -58,10 +59,11 @@ type Config struct {
// UserContext is the context for the user
type UserContext struct {
Username string
IsLoggedIn bool
OAuth bool
Provider string
Username string
IsLoggedIn bool
OAuth bool
Provider string
TotpPending bool
}
// APIConfig is the configuration for the API
@@ -114,8 +116,9 @@ type UnauthorizedQuery struct {
// SessionCookie is the cookie for the session (exculding the expiry)
type SessionCookie struct {
Username string
Provider string
Username string
Provider string
TotpPending bool
}
// TinyauthLabels is the labels for the tinyauth container
@@ -147,4 +150,10 @@ type Status struct {
DisableContinue bool `json:"disableContinue"`
Title string `json:"title"`
GenericName string `json:"genericName"`
TotpPending bool `json:"totpPending"`
}
// Totp request
type Totp struct {
Code string `json:"code"`
}