Change magic_link_ttl old name to auth_code_ttl
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user