forked from mtusi2026/mtusi2026lab2
lab2: review round 2 — cache versioning, UUID normalization, cursor validation, benchmark evidence
This commit is contained in:
@@ -68,7 +68,9 @@ func (s *AuthService) ValidateSession(ctx context.Context, token string) (*domai
|
||||
if errors.Is(err, repository.ErrNotFound) {
|
||||
return nil, ErrUnauthorized
|
||||
}
|
||||
return nil, err
|
||||
// Redis недоступен — возвращаем 401, чтобы клиент перелогинился,
|
||||
// либо 503, если хотим явно показать проблему зависимости.
|
||||
return nil, ErrUnauthorized // ← было: return nil, err
|
||||
}
|
||||
if nowUTC().After(sess.ExpiresAt) {
|
||||
_ = s.sessions.Delete(ctx, token)
|
||||
|
||||
Reference in New Issue
Block a user