fix: userId typing

This commit is contained in:
AmirMahdi Qiasvand 2025-09-16 11:34:21 +03:30
parent e3d37a8e4d
commit 7a365f57ec
2 changed files with 3 additions and 4 deletions

View File

@ -131,9 +131,8 @@ func (s *authService) Authenticate(ctx context.Context, pubKey string, signature
return nil, fmt.Errorf("failed to create session: %w", err) return nil, fmt.Errorf("failed to create session: %w", err)
} }
//FIXME: KYC level will be set to 1
claims := &jwt.UserClaims{ claims := &jwt.UserClaims{
UserID: uint(user.ID.ID()), UserID: user.ID.String(),
KYCLevel: int(user.KYCLevel), KYCLevel: int(user.KYCLevel),
Sections: []string{}, Sections: []string{},
} }
@ -147,7 +146,7 @@ func (s *authService) Authenticate(ctx context.Context, pubKey string, signature
refreshExpiresAt := time.Now().Add(time.Duration(s.cfg.JWT.RefreshTokenExpMinutes) * time.Minute) refreshExpiresAt := time.Now().Add(time.Duration(s.cfg.JWT.RefreshTokenExpMinutes) * time.Minute)
refreshClaims := &jwt.UserClaims{ refreshClaims := &jwt.UserClaims{
UserID: uint(user.ID.ID()), UserID: user.ID.String(),
KYCLevel: int(user.KYCLevel), KYCLevel: int(user.KYCLevel),
Sections: []string{"refresh"}, Sections: []string{"refresh"},
} }

View File

@ -4,7 +4,7 @@ import jwt2 "github.com/golang-jwt/jwt/v5"
type UserClaims struct { type UserClaims struct {
jwt2.RegisteredClaims jwt2.RegisteredClaims
UserID uint UserID string
KYCLevel int KYCLevel int
Sections []string Sections []string
} }