fix: resolve folder drag-and-drop, add remember me, fix pinned folder navigation
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m18s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m18s
This commit is contained in:
parent
7278008d7e
commit
b668418951
5 changed files with 89 additions and 14 deletions
|
|
@ -86,11 +86,16 @@ func GenerateAccessToken(userID int, username, secret string, expirySecs int) (s
|
|||
}
|
||||
|
||||
// GenerateRefreshToken creates a longer-lived refresh token.
|
||||
func GenerateRefreshToken(userID int, username, secret string) (string, error) {
|
||||
func GenerateRefreshToken(userID int, username, secret string, rememberMe bool) (string, error) {
|
||||
exp := time.Now().Add(7 * 24 * time.Hour).Unix() // 7 days
|
||||
if rememberMe {
|
||||
exp = time.Now().Add(21 * 24 * time.Hour).Unix() // 21 days (3 weeks)
|
||||
}
|
||||
|
||||
claims := jwt.MapClaims{
|
||||
"sub": userID,
|
||||
"username": username,
|
||||
"exp": time.Now().Add(7 * 24 * time.Hour).Unix(), // 7 days
|
||||
"exp": exp,
|
||||
"iat": time.Now().Unix(),
|
||||
"type": "refresh",
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue