Skip to content

Commit

Permalink
Adds diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho committed May 22, 2024
1 parent 9ca547d commit 9bcd660
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion web/docs/auth/auth-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Auth Hooks
---

import { EmailPill, UsernameAndPasswordPill, GithubPill, GooglePill, KeycloakPill } from "./Pills";

import ImgWithCaption from '@site/blog/components/ImgWithCaption'

Sometimes you need to do some action _before_ the user signs up or _after_ they sign up. Or you need to access the OAuth redirect URL or the OAuth access token. For these cases, you can use the Auth Hooks.

Expand Down Expand Up @@ -33,6 +33,21 @@ Wasp _awaits_ the async hook functions in various stages of the auth process. Th

The return value is ignored for all hooks except `onBeforeOAuthRedirect` which enables you to modify the OAuth redirect URL.

#### When Are the Hooks Called

<ImgWithCaption
source="/img/auth-hooks/signup_flow_with_hooks.png"
alt="Signup Flow with Hooks"
caption="Signup Flow with Hooks"
/>

<ImgWithCaption
source="/img/auth-hooks/oauth_flow_with_hooks.png"
alt="OAuth Flow with Hooks"
caption="OAuth Flow with Hooks"
/>



### `onBeforeSignup` hook

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9bcd660

Please sign in to comment.