mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +08:00
fix: no database check when using accessToken (#461)
Signed-off-by: 0x2a <stevesough@gmail.com>
This commit is contained in:
@ -28,3 +28,10 @@ func GetCurrentTime() string {
|
||||
func GetCurrentUnixTime() string {
|
||||
return strconv.FormatInt(time.Now().UnixNano(), 10)
|
||||
}
|
||||
|
||||
func CheckTokenExpireTime(createdTime string, expireIn int) bool {
|
||||
create, _ := time.Parse(time.RFC3339, createdTime)
|
||||
expireAt := create.Add(time.Duration(expireIn) * time.Minute)
|
||||
|
||||
return time.Now().Before(expireAt)
|
||||
}
|
||||
|
Reference in New Issue
Block a user