mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-23 13:54:04 +08:00
fix: custom token expires in doesn't work
This commit is contained in:
parent
a624121095
commit
dc73c2e97d
2
.github/workflows/issue_close_inactive.yml
vendored
2
.github/workflows/issue_close_inactive.yml
vendored
@ -4,7 +4,7 @@ on:
|
||||
schedule:
|
||||
- cron: "0 0 */7 * *"
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
jobs:
|
||||
close-inactive:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -3,6 +3,7 @@ package common
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/alist-org/alist/v3/internal/conf"
|
||||
"github.com/golang-jwt/jwt/v4"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
@ -18,7 +19,7 @@ func GenerateToken(username string) (tokenString string, err error) {
|
||||
claim := UserClaims{
|
||||
Username: username,
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
ExpiresAt: jwt.NewNumericDate(time.Now().Add(48 * time.Hour)),
|
||||
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Duration(conf.Conf.TokenExpiresIn) * time.Hour)),
|
||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||
NotBefore: jwt.NewNumericDate(time.Now()),
|
||||
}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user