Add saving user, add nonpersistant register login handling
This commit is contained in:
@@ -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()),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user