mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +08:00
Improve code format.
This commit is contained in:
@ -29,9 +29,8 @@ 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)
|
||||
func IsTokenExpired(createdTime string, expiresIn int) bool {
|
||||
createdTimeObj, _ := time.Parse(time.RFC3339, createdTime)
|
||||
expiresAtObj := createdTimeObj.Add(time.Duration(expiresIn) * time.Minute)
|
||||
return time.Now().Before(expiresAtObj)
|
||||
}
|
||||
|
Reference in New Issue
Block a user