Skip to main content
zerotal

Documentation


Documentation / @zerotal/admin / index / AdminAuthConfig

Interface: AdminAuthConfig

Defined in: admin/src/config.ts:27

Auth-pages configuration. When enabled, the panel mounts a login screen (using @zerotal/auth's Auth.attempt) and an in-panel profile page (update details + change password + sign out). Password-reset and email-verification pages are mounted when their broker hooks are supplied (the admin owns the UI; the app supplies the data — same split as the notification provider).

Properties

enabled?

optional enabled?: boolean

Defined in: admin/src/config.ts:29

Mount the auth pages.


loginPath?

optional loginPath?: string

Defined in: admin/src/config.ts:31

Login route (relative to the panel path). Default /login.


profilePath?

optional profilePath?: string

Defined in: admin/src/config.ts:33

Profile route (relative to the panel path). Default /profile.


redirectTo?

optional redirectTo?: string

Defined in: admin/src/config.ts:35

Where to send the user after a successful login. Default the panel root.


identifier?

optional identifier?: string

Defined in: admin/src/config.ts:37

The credential column users log in with. Default "email".


remember?

optional remember?: boolean

Defined in: admin/src/config.ts:39

Show a "remember me" checkbox. Default true.


heading?

optional heading?: string

Defined in: admin/src/config.ts:41

Heading on the auth screens. Defaults to the panel brand.


authenticateWhen?

optional authenticateWhen?: (user) => boolean | Promise<boolean>

Defined in: admin/src/config.ts:43

Extra gate after the password check (e.g. "is the account active?").

Parameters

user

unknown

Returns

boolean | Promise<boolean>


updateProfile?

optional updateProfile?: (user, data) => void | Promise<void>

Defined in: admin/src/config.ts:45

Persist profile edits (name/email). Defaults to user.fill(data); user.save().

Parameters

user

unknown

data

Record<string, unknown>

Returns

void | Promise<void>


guestMiddleware?

optional guestMiddleware?: MiddlewareClass[]

Defined in: admin/src/config.ts:47

Middleware guarding the guest screens (login/forgot/reset). Default none.


authMiddleware?

optional authMiddleware?: MiddlewareClass[]

Defined in: admin/src/config.ts:49

Middleware guarding the profile/verify screens. Defaults to the panel guard.


passwordReset?

optional passwordReset?: object

Defined in: admin/src/config.ts:51

Password-reset broker — mounting the forgot/reset pages when provided.

sendResetLink(email): boolean | Promise<boolean>

Parameters
email

string

Returns

boolean | Promise<boolean>

reset()

reset(input): boolean | Promise<boolean>

Parameters
input
email

string

token

string

password

string

Returns

boolean | Promise<boolean>


emailVerification?

optional emailVerification?: object

Defined in: admin/src/config.ts:56

Email-verification hooks — mounting the verify page when provided.

isVerified()

isVerified(user): boolean

Parameters
user

unknown

Returns

boolean

resend()

resend(user): void | Promise<void>

Parameters
user

unknown

Returns

void | Promise<void>