add: register and login with DB query AND some struct type correction
This commit is contained in:
@@ -43,7 +43,7 @@ func (s *AuthService) Login(email, password string) (*models.LoginResponse, erro
|
||||
}
|
||||
|
||||
if user == nil {
|
||||
return nil, ErrInvalidCredentials
|
||||
return nil, ErrUserNotFound
|
||||
}
|
||||
|
||||
// Verify password
|
||||
@@ -104,6 +104,7 @@ func (s *AuthService) Login(email, password string) (*models.LoginResponse, erro
|
||||
redirectURL = "/"
|
||||
}
|
||||
|
||||
// TODO: Apakah kita perlu param email untuk generate access token?
|
||||
// Generate tokens
|
||||
accessToken, err := s.jwtManager.GenerateAccessToken(user.ID, user.Email, user.Role, user.Name, additionalClaims)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user