generate open token using normal token
All checks were successful
Release and Deploy / build (push) Successful in 3m1s
Release and Deploy / deploy (push) Successful in 23s

This commit is contained in:
Fran Jurmanović
2025-08-17 12:46:37 +02:00
parent 486c972bba
commit edad65d6a9
6 changed files with 19 additions and 14 deletions

View File

@@ -63,16 +63,11 @@ func (s *MembershipService) Login(ctx context.Context, username, password string
return "", err
}
return s.jwtHandler.GenerateToken(user)
return s.jwtHandler.GenerateToken(user.ID.String())
}
func (s *MembershipService) GenerateOpenToken(ctx context.Context, userId string) (string, error) {
user, err := s.repo.GetByID(ctx, userId)
if err != nil {
return "", err
}
return s.openJwtHandler.GenerateToken(user)
return s.openJwtHandler.GenerateToken(userId)
}
// CreateUser creates a new user.