pub enum AdminError {
Show 24 variants
YouCannotBanYourself,
YouAreNotAllowedToChangeUsersRole,
YouAreNotAllowedToCreateUsers,
YouAreNotAllowedToListUsers,
YouAreNotAllowedToListUsersSessions,
YouAreNotAllowedToBanUsers,
YouAreNotAllowedToImpersonateUsers,
YouAreNotAllowedToRevokeUsersSessions,
YouAreNotAllowedToDeleteUsers,
YouAreNotAllowedToSetUsersPassword,
BannedUser {
message: String,
},
YouAreNotAllowedToGetUser,
NoDataToUpdate,
YouAreNotAllowedToUpdateUsers,
YouCannotRemoveYourself,
YouAreNotAllowedToSetNonExistentValue,
YouCannotImpersonateAdmins,
InvalidRoleType,
YouAreNotAllowedToSetUsersEmail,
PasswordCannotBeUpdatedViaUpdateUser,
UserIdCannotBeUpdated,
YouCannotManageAdmins,
NotAllowedWhileImpersonating,
NotImpersonating,
}Expand description
Why an admin request failed. Codes, statuses and messages match Better Auth’s admin
plugin; USER_NOT_FOUND, INVALID_EMAIL and USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL
come from core.
Variants§
YouCannotBanYourself
YouAreNotAllowedToChangeUsersRole
YouAreNotAllowedToCreateUsers
YouAreNotAllowedToListUsers
YouAreNotAllowedToListUsersSessions
YouAreNotAllowedToBanUsers
YouAreNotAllowedToImpersonateUsers
YouAreNotAllowedToRevokeUsersSessions
YouAreNotAllowedToDeleteUsers
YouAreNotAllowedToSetUsersPassword
BannedUser
A banned user tried to sign in. The message is the configured banned-user message plus the ban’s reason.
YouAreNotAllowedToGetUser
NoDataToUpdate
YouAreNotAllowedToUpdateUsers
YouCannotRemoveYourself
YouAreNotAllowedToSetNonExistentValue
YouCannotImpersonateAdmins
InvalidRoleType
YouAreNotAllowedToSetUsersEmail
PasswordCannotBeUpdatedViaUpdateUser
UserIdCannotBeUpdated
YouCannotManageAdmins
An admin without user:impersonate-admins acted on another admin’s account (set its
password, email, role or ban, removed it or revoked its sessions). fastauth only.
NotAllowedWhileImpersonating
An impersonation session tried to create or change a credential (an API key, a passkey, a linked account, two-factor). fastauth only.
NotImpersonating
/admin/stop-impersonating from a session that isn’t impersonating.
Trait Implementations§
Source§impl Clone for AdminError
impl Clone for AdminError
Source§impl Debug for AdminError
impl Debug for AdminError
impl Eq for AdminError
Source§impl ErrorCodes for AdminError
impl ErrorCodes for AdminError
Source§impl From<AdminError> for AuthError
impl From<AdminError> for AuthError
Source§fn from(error: AdminError) -> Self
fn from(error: AdminError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for AdminError
impl PartialEq for AdminError
impl StructuralPartialEq for AdminError
Auto Trait Implementations§
impl Forget for AdminError
impl Freeze for AdminError
impl Move for AdminError
impl RefUnwindSafe for AdminError
impl Send for AdminError
impl Sync for AdminError
impl Unpin for AdminError
impl UnsafeUnpin for AdminError
impl UnwindSafe for AdminError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more