AuthN takes care of account data (username, password) and leaves the remaining user profile data to your application. This means that signup is a two-step process. If that inspires you to create a two-step user flow, that could be nice! But you can also create a traditional one-step signup process that submits with two API calls.
- Create a form that collects a user's preferred username (email?) and password.
- Additionally collect other fields like name, newsletter subscriptions, as needed.
- Validate everything, especially your account fields.
- Submit the username (email?) and password to AuthN.
- If AuthN creates an account, the user will be logged in without a user profile.
- Submit the remaining details to your application.
NOTE: If a user succeeds in creating an account (step 5) but fails to create a user (step 7) then your frontend needs a plan for how to rerun step 6 while preserving the result of step 5. Validating the data client-side (step 3) is important because it will significantly reduce the odds of this happening.
NOTE: If you are using emails as username (by setting USERNAME_IS_EMAIL to
true) and you need the email for user profile as well then consider using either authn or your application as the source of truth. You can either:
- Validate and save the user's AuthN
account_idalong with your other user profile fields.