From 7a365f57ecfb0f0a8314ea835e114baeff02e83b Mon Sep 17 00:00:00 2001 From: AmirMahdi Qiasvand Date: Tue, 16 Sep 2025 11:34:21 +0330 Subject: [PATCH] fix: userId typing --- internal/usecase/auth_service.go | 5 ++--- pkg/jwt/claims.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/usecase/auth_service.go b/internal/usecase/auth_service.go index e4b2916..d06f1f4 100644 --- a/internal/usecase/auth_service.go +++ b/internal/usecase/auth_service.go @@ -131,9 +131,8 @@ func (s *authService) Authenticate(ctx context.Context, pubKey string, signature return nil, fmt.Errorf("failed to create session: %w", err) } - //FIXME: KYC level will be set to 1 claims := &jwt.UserClaims{ - UserID: uint(user.ID.ID()), + UserID: user.ID.String(), KYCLevel: int(user.KYCLevel), 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) refreshClaims := &jwt.UserClaims{ - UserID: uint(user.ID.ID()), + UserID: user.ID.String(), KYCLevel: int(user.KYCLevel), Sections: []string{"refresh"}, } diff --git a/pkg/jwt/claims.go b/pkg/jwt/claims.go index 2ed10a3..cecc6ca 100644 --- a/pkg/jwt/claims.go +++ b/pkg/jwt/claims.go @@ -4,7 +4,7 @@ import jwt2 "github.com/golang-jwt/jwt/v5" type UserClaims struct { jwt2.RegisteredClaims - UserID uint + UserID string KYCLevel int Sections []string }