Shorter JWT token lifetime to enter chat

face-detect
Noah Petherbridge 2023-04-19 19:56:09 -07:00
parent 0527ff54b5
commit 7af6d82fc7
1 changed files with 1 additions and 3 deletions

View File

@ -82,9 +82,7 @@ func Landing() http.HandlerFunc {
ProfileURL: "/u/" + currentUser.Username,
Nickname: currentUser.NameOrUsername(),
RegisteredClaims: jwt.RegisteredClaims{
// TODO: ExpiresAt 60 minutes to work around chat server reliability,
// should be shorter like 5 minutes.
ExpiresAt: jwt.NewNumericDate(time.Now().Add(60 * time.Minute)),
ExpiresAt: jwt.NewNumericDate(time.Now().Add(5 * time.Minute)),
IssuedAt: jwt.NewNumericDate(time.Now()),
NotBefore: jwt.NewNumericDate(time.Now()),
Issuer: config.Title,