Sometimes, you may want to collect additional information from users during sign-up, for example a real name or address. The most straightforward approach is to redirect users to an onboarding page right after they sign up. However, this is not recommended for the following reasons:Documentation Index
Fetch the complete documentation index at: https://stackauth-e0affa27-chore-move-mcp-to-a-sep-app.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- Users can accidentally (or purposefully) close or navigate away from the page before completing the onboarding.
- Redirect URLs may vary depending on the context. For instance, if a user is redirected to a sign-in page after trying to access a protected page, they’ll expect to return to the original protected page post-authentication.
onboarded flag in the user’s metadata and redirect users to the onboarding page if they haven’t completed it yet.
Example implementation
Let’s say you have an onboarding page that asks for an address and stores it in the user’s metadata:While the above implementation offers a basic onboarding process, users can still skip onboarding by directly sending an API request to update the
clientMetadata.onboarded flag. If you want to ensure that onboarding cannot be bypassed on the API level, you should create a server endpoint to validate and store the data, then save the onboarded flag in the clientReadOnlyMetadata on the server side after validation.- Client Component
- Server Component
- Client Component
- Server Component