Add saving user, add nonpersistant register login handling

This commit is contained in:
2026-03-17 21:40:48 +01:00
parent e496cb0017
commit d3fc2a65d9
9 changed files with 160 additions and 25 deletions
+2 -2
View File
@@ -9,10 +9,10 @@ import (
var secretKey = []byte("replace-with-env-variable")
func GetToken(client *Client) (string, error) {
func GetToken(clientId uint32) (string, error) {
token := jwt.NewWithClaims(jwt.SigningMethodHS256,
jwt.RegisteredClaims{
Subject: strconv.Itoa(int(client.Id)),
Subject: strconv.Itoa(int(clientId)),
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Hour)),
IssuedAt: jwt.NewNumericDate(time.Now()),
},