type

AuthHooks

Authentication lifecycle callbacks grouped by phase.

Properties

PropertyTypeDescription
BeforeLogin[]AuthHookBefore Login callbacks in declaration order.
AfterLogin[]AuthHookAfter Login callbacks in declaration order.
AfterMe[]AuthHookAfter Me callbacks in declaration order.
BeforeLogout[]AuthHookBefore Logout callbacks in declaration order.
AfterLogout[]AuthHookAfter Logout callbacks in declaration order.
BeforeRotate[]AuthHookThe BeforeRotate value.
AfterRotate[]AuthHookThe AfterRotate value.
BeforeForgotPassword[]AuthHookBefore Forgot Password callbacks in declaration order.
AfterForgotPassword[]AuthHookAfter Forgot Password callbacks in declaration order.
BeforePasswordReset[]AuthHookBefore Password Reset callbacks in declaration order.
AfterPasswordReset[]AuthHookAfter Password Reset callbacks in declaration order.
BeforeVerification[]AuthHookBefore Verification callbacks in declaration order.
AfterVerification[]AuthHookAfter Verification callbacks in declaration order.
BeforeAPIKey[]AuthHookBefore APIKey callbacks in declaration order.
AfterAPIKey[]AuthHookAfter APIKey callbacks in declaration order.

How it works

Before hooks can reject an operation. If an after-login or after-refresh hook fails, Ridu revokes the newly issued credential before returning the error.

Full signature

type AuthHooks struct { BeforeLogin []AuthHook AfterLogin []AuthHook AfterMe []AuthHook BeforeLogout []AuthHook AfterLogout []AuthHook BeforeRotate []AuthHook AfterRotate []AuthHook BeforeForgotPassword []AuthHook AfterForgotPassword []AuthHook BeforePasswordReset []AuthHook AfterPasswordReset []AuthHook BeforeVerification []AuthHook AfterVerification []AuthHook BeforeAPIKey []AuthHook AfterAPIKey []AuthHook }

Source core/auth_contract.go:58