Login: handle custom token creation error messages (#31283)
* Login: handle custom token creation errors * Login: handle external error for OAuth responses
This commit is contained in:
@@ -11,6 +11,20 @@ var (
|
||||
ErrUserTokenNotFound = errors.New("user token not found")
|
||||
)
|
||||
|
||||
// CreateTokenErr represents a token creation error; used in Enterprise
|
||||
type CreateTokenErr struct {
|
||||
StatusCode int
|
||||
InternalErr error
|
||||
ExternalErr string
|
||||
}
|
||||
|
||||
func (e *CreateTokenErr) Error() string {
|
||||
if e.InternalErr != nil {
|
||||
return e.InternalErr.Error()
|
||||
}
|
||||
return "failed to create token"
|
||||
}
|
||||
|
||||
type TokenExpiredError struct {
|
||||
UserID int64
|
||||
TokenID int64
|
||||
|
||||
Reference in New Issue
Block a user