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
|
turnstile_secret: example
|
||||||
client_secret_key: example
|
client_secret_key: example
|
||||||
ttl:
|
ttl:
|
||||||
magic_link_ttl: 10m
|
auth_code_ttl: 10m
|
||||||
access_ttl: 15s
|
access_ttl: 15s
|
||||||
refresh_ttl: 168h
|
refresh_ttl: 168h
|
||||||
checkin_code_ttl: 10m
|
checkin_code_ttl: 10m
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ type secrets struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ttl struct {
|
type ttl struct {
|
||||||
MagicLinkTTL string `yaml:"magic_link_ttl"`
|
AuthCodeTTL string `yaml:"auth_code_ttl"`
|
||||||
AccessTTL string `yaml:"access_ttl"`
|
AccessTTL string `yaml:"access_ttl"`
|
||||||
RefreshTTL string `yaml:"refresh_ttl"`
|
RefreshTTL string `yaml:"refresh_ttl"`
|
||||||
CheckinCodeTTL string `yaml:"checkin_code_ttl"`
|
CheckinCodeTTL string `yaml:"checkin_code_ttl"`
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ func NewAuthCode(email string) (string, error) {
|
|||||||
|
|
||||||
store.Store(code, Token{
|
store.Store(code, Token{
|
||||||
Email: email,
|
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
|
return code, nil
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ func Magic(c *gin.Context) {
|
|||||||
query.Set("code", code)
|
query.Set("code", code)
|
||||||
query.Set("redirect_uri", req.RedirectUri)
|
query.Set("redirect_uri", req.RedirectUri)
|
||||||
query.Set("state", req.State)
|
query.Set("state", req.State)
|
||||||
|
query.Set("client_id", req.ClientId)
|
||||||
url.RawQuery = query.Encode()
|
url.RawQuery = query.Encode()
|
||||||
|
|
||||||
debugMode := viper.GetBool("server.debug_mode")
|
debugMode := viper.GetBool("server.debug_mode")
|
||||||
|
|||||||
Reference in New Issue
Block a user