Skip to main content

BeforeLogoutFunction

BeforeLogoutFunction = (params) => Promise<void>

Called when user logs out, before AdminForth removes auth cookie. Useful for cleanup of things issued for the session (e.g. revoking tokens on external identity provider, removing custom cookies set by plugins) or for logging logout event.

Parameters

ParameterTypeDescription
params{ adminforth: IAdminForth; adminUser: AdminUser | null; extra: HttpExtra; tr: ITranslateFunction; }-
params.adminforthIAdminForthAdminforth instance.
params.adminUserAdminUser | nullUser which is logging out. Is null when session was already expired or invalid at the moment of logout.
params.extraHttpExtraExtra HTTP information of logout request. Use extra.response to set custom status, headers or cookies.
params.trITranslateFunctionTranslate function, respects language of logout request.

Returns

Promise<void>