(ctx context.Context, input UserSignInInput)
| 89 | } |
| 90 | |
| 91 | func (s *UsersService) SignIn(ctx context.Context, input UserSignInInput) (Tokens, error) { |
| 92 | passwordHash, err := s.hasher.Hash(input.Password) |
| 93 | if err != nil { |
| 94 | return Tokens{}, err |
| 95 | } |
| 96 | |
| 97 | user, err := s.repo.GetByCredentials(ctx, input.Email, passwordHash) |
| 98 | if err != nil { |
| 99 | if errors.Is(err, domain.ErrUserNotFound) { |
| 100 | return Tokens{}, err |
| 101 | } |
| 102 | |
| 103 | return Tokens{}, err |
| 104 | } |
| 105 | |
| 106 | return s.createSession(ctx, user.ID) |
| 107 | } |
| 108 | |
| 109 | func (s *UsersService) RefreshTokens(ctx context.Context, refreshToken string) (Tokens, error) { |
| 110 | student, err := s.repo.GetByRefreshToken(ctx, refreshToken) |
nothing calls this directly
no test coverage detected