feat: new ValidateToken method for AuthService, based on code from the monolithic implementation of auth middleware;

feat: add detailed authentication error types;
This commit is contained in:
2025-07-15 21:59:05 +03:00
parent b3a405016e
commit a582b75c82
2 changed files with 85 additions and 1 deletions

View File

@@ -29,4 +29,10 @@ var (
ErrInvalidCredentials = errors.New("Invalid username, password or TOTP code")
ErrInvalidToken = errors.New("Token is invalid or expired")
ErrServerError = errors.New("Internal server error")
ErrTokenExpired = errors.New("Token is expired")
ErrTokenInvalid = errors.New("Token is invalid")
ErrWrongTokenType = errors.New("Invalid token type")
ErrSessionNotFound = errors.New("Could not find session in database")
ErrSessionTerminated = errors.New("Session is terminated")
)