Change magic_link_ttl old name to auth_code_ttl
All checks were successful
Build Backend (NixCN CMS) TeamCity build finished
Build Frontend (NixCN CMS) TeamCity build finished

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-01-02 16:37:30 +08:00
parent d70ade4907
commit 0b710fd538
4 changed files with 4 additions and 3 deletions

View File

@@ -32,7 +32,7 @@ secrets:
turnstile_secret: example
client_secret_key: example
ttl:
magic_link_ttl: 10m
auth_code_ttl: 10m
access_ttl: 15s
refresh_ttl: 168h
checkin_code_ttl: 10m

View File

@@ -56,7 +56,7 @@ type secrets struct {
}
type ttl struct {
MagicLinkTTL string `yaml:"magic_link_ttl"`
AuthCodeTTL string `yaml:"auth_code_ttl"`
AccessTTL string `yaml:"access_ttl"`
RefreshTTL string `yaml:"refresh_ttl"`
CheckinCodeTTL string `yaml:"checkin_code_ttl"`

View File

@@ -29,7 +29,7 @@ func NewAuthCode(email string) (string, error) {
store.Store(code, Token{
Email: email,
ExpiresAt: time.Now().Add(viper.GetDuration("ttl.magic_link_ttl")),
ExpiresAt: time.Now().Add(viper.GetDuration("ttl.auth_code_ttl")),
})
return code, nil

View File

@@ -49,6 +49,7 @@ func Magic(c *gin.Context) {
query.Set("code", code)
query.Set("redirect_uri", req.RedirectUri)
query.Set("state", req.State)
query.Set("client_id", req.ClientId)
url.RawQuery = query.Encode()
debugMode := viper.GetBool("server.debug_mode")