type
AuthHooks
Authentication lifecycle callbacks grouped by phase.
Properties
| Property | Type | Description |
|---|---|---|
BeforeLogin | []AuthHook | Before Login callbacks in declaration order. |
AfterLogin | []AuthHook | After Login callbacks in declaration order. |
AfterMe | []AuthHook | After Me callbacks in declaration order. |
BeforeLogout | []AuthHook | Before Logout callbacks in declaration order. |
AfterLogout | []AuthHook | After Logout callbacks in declaration order. |
BeforeRotate | []AuthHook | The BeforeRotate value. |
AfterRotate | []AuthHook | The AfterRotate value. |
BeforeForgotPassword | []AuthHook | Before Forgot Password callbacks in declaration order. |
AfterForgotPassword | []AuthHook | After Forgot Password callbacks in declaration order. |
BeforePasswordReset | []AuthHook | Before Password Reset callbacks in declaration order. |
AfterPasswordReset | []AuthHook | After Password Reset callbacks in declaration order. |
BeforeVerification | []AuthHook | Before Verification callbacks in declaration order. |
AfterVerification | []AuthHook | After Verification callbacks in declaration order. |
BeforeAPIKey | []AuthHook | Before APIKey callbacks in declaration order. |
AfterAPIKey | []AuthHook | After 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
}