2021-12-16 04:11:33 +00:00
|
|
|
package auth
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"kumoly.io/kumoly/app/errors"
|
|
|
|
)
|
|
|
|
|
|
|
|
var ErrorLoginFailed = errors.Error{
|
|
|
|
Code: http.StatusUnauthorized,
|
|
|
|
ID: "ErrorLoginFailed",
|
|
|
|
Message: "Wrong username or password.",
|
|
|
|
}
|
|
|
|
|
|
|
|
var ErrorUserNotActivated = errors.Error{
|
|
|
|
Code: http.StatusForbidden,
|
|
|
|
ID: "ErrorUserNotActivated",
|
|
|
|
Message: "User is not activated.",
|
|
|
|
}
|
|
|
|
|
|
|
|
var ErrorUserIsSSO = errors.Error{
|
|
|
|
Code: http.StatusForbidden,
|
|
|
|
ID: "ErrorUserIsSSO",
|
|
|
|
Message: "user is sso enabled.",
|
|
|
|
}
|
|
|
|
|
|
|
|
var ErrorTokenNotValid = errors.Error{
|
|
|
|
Code: http.StatusUnauthorized,
|
|
|
|
ID: "ErrorTokenNotValid",
|
|
|
|
Message: "token not valid",
|
|
|
|
}
|
|
|
|
|
|
|
|
var ErrorUnknownClaims = errors.Error{
|
|
|
|
Code: http.StatusUnauthorized,
|
|
|
|
ID: "ErrorUnknownClaims",
|
|
|
|
Message: "unknown claims",
|
|
|
|
}
|
|
|
|
|
|
|
|
var ErrorDelLastAdmin = errors.Error{
|
|
|
|
Code: http.StatusForbidden,
|
|
|
|
ID: "ErrorDelLastAdmin",
|
|
|
|
Message: "Cannot remove last admin account.",
|
|
|
|
}
|
|
|
|
|
|
|
|
var ErrorBadRequestTmpl = errors.Error{
|
|
|
|
Code: http.StatusBadRequest,
|
|
|
|
ID: "ErrorBadRequest",
|
|
|
|
Tmpl: "%v is not sufficient.",
|
|
|
|
}
|
2021-12-18 08:51:32 +00:00
|
|
|
|
|
|
|
var ErrorUserExist = errors.Error{
|
|
|
|
Code: http.StatusBadRequest,
|
|
|
|
ID: "ErrorUserExist",
|
|
|
|
Message: "User exists.",
|
|
|
|
}
|