feat: change password now requires old/current password

This commit is contained in:
2026-08-29 17:39:58 +02:00
parent 68d45db8cd
commit da3b2a5a6e
3 changed files with 13 additions and 4 deletions
+2 -2
View File
@@ -62,7 +62,7 @@ func NewAuthService(r AuthRepository, jwtSecret []byte) *AuthService {
return &AuthService{repo: r, jwtSecret: jwtSecret}
}
func (s *AuthService) authenticate(ctx context.Context, email string, password string) (*AuthUser, error) {
func (s *AuthService) Authenticate(ctx context.Context, email string, password string) (*AuthUser, error) {
user, err := s.repo.GetUserByEmail(ctx, email)
if err != nil {
return user, err
@@ -80,7 +80,7 @@ func (s *AuthService) authenticate(ctx context.Context, email string, password s
}
func (s *AuthService) Login(ctx context.Context, email string, password string) (TokenPair, error) {
user, err := s.authenticate(ctx, email, password)
user, err := s.Authenticate(ctx, email, password)
if err != nil {
return TokenPair{}, err
}