add forget password
This commit is contained in:
+19
-4
@@ -3,10 +3,16 @@ package config
|
||||
import "time"
|
||||
|
||||
type AuthConfig struct {
|
||||
jwtTokenExpiresTTL int
|
||||
jwtTokenSecret string
|
||||
jwtOrderSecret string
|
||||
jwtOrderExpiresTTL int
|
||||
jwtTokenExpiresTTL int
|
||||
jwtTokenSecret string
|
||||
jwtOrderSecret string
|
||||
jwtOrderExpiresTTL int
|
||||
jwtSecretResetPassword JWT
|
||||
}
|
||||
|
||||
type JWT struct {
|
||||
secret string
|
||||
expireTTL int
|
||||
}
|
||||
|
||||
func (c *AuthConfig) AccessTokenSecret() string {
|
||||
@@ -26,3 +32,12 @@ func (c *AuthConfig) AccessTokenExpiresDate() time.Time {
|
||||
duration := time.Duration(c.jwtTokenExpiresTTL)
|
||||
return time.Now().UTC().Add(time.Minute * duration)
|
||||
}
|
||||
|
||||
func (c *AuthConfig) AccessTokenResetPasswordSecret() string {
|
||||
return c.jwtSecretResetPassword.secret
|
||||
}
|
||||
|
||||
func (c *AuthConfig) AccessTokenResetPasswordExpire() time.Time {
|
||||
duration := time.Duration(c.jwtSecretResetPassword.expireTTL)
|
||||
return time.Now().UTC().Add(time.Minute * duration)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user