1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-13 20:25:57 +01:00

Set token expiration time.

This commit is contained in:
Juliusz Chroboczek 2024-10-25 17:51:42 +02:00
parent 54b4759300
commit ac03b610ef

View file

@ -17,6 +17,7 @@ import (
"path/filepath" "path/filepath"
"slices" "slices"
"strings" "strings"
"time"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
"golang.org/x/crypto/pbkdf2" "golang.org/x/crypto/pbkdf2"
@ -890,6 +891,7 @@ func createTokenCmd(cmdname string, args []string) {
} }
t := make(map[string]any) t := make(map[string]any)
t["permissions"] = perms t["permissions"] = perms
t["expires"] = time.Now().Add(24 * time.Hour)
if username != "" { if username != "" {
t["username"] = username t["username"] = username
} }