Home > react-directus > DirectusAuthHook
A set of functions and data to manage authentication.
Signature:
export interface DirectusAuthHook
Property | Modifiers | Type | Description |
---|---|---|---|
authState | AuthStates | Represents the current authentication state. | |
login | (email: string, password: string) => Promise<void> | Login the user. If successful, the user will be stored in the context. Else, an error will be thrown. | |
logout | () => Promise<void> | Logout the user. If successful, the user will be removed from the context. Else, an error will be thrown. | |
user | UserType | null | The current authenticated user. |