This commit is contained in:
2026-03-17 19:51:47 +01:00
parent 84c9fa2b60
commit e496cb0017
5 changed files with 42 additions and 19 deletions
+2 -2
View File
@@ -20,8 +20,8 @@ func GetToken(client *Client) (string, error) {
return token.SignedString(secretKey)
}
func GetClientIdFromToken(token *string) (uint32, error) {
parsed, err := jwt.ParseWithClaims(*token, &jwt.RegisteredClaims{}, func(t *jwt.Token) (any, error) {
func GetClientIdFromToken(token string) (uint32, error) {
parsed, err := jwt.ParseWithClaims(token, &jwt.RegisteredClaims{}, func(t *jwt.Token) (any, error) {
if _, ok := t.Method.(*jwt.SigningMethodHMAC); !ok {
return nil, jwt.ErrSignatureInvalid
}