Hydrogen 2.0 is out now. These archival Hydrogen 1.0 docs are provided only to assist developers during their upgrade process. Please migrate to Hydrogen 2.0 as soon as possible.
Hydrogen includes built-in support for managing user authentication, including account creation, login, password reset, and logout. This guide describes the routes, hooks, and components that you can use to implement an end-to-end user authentication experience.
User account routes
The Demo Store template contains the following user account-specific routes:
|An account settings page for the current logged in user. If the user isn't logged in when they access this page, then they're redirected to |
|A page for the user to enter their credentials and log in.|
|An API route that expects a |
|A form for the user to set up a new account. On success, the user is redirected to |
|A form for the user to initiate a password reset. If the form is sent successfully, then an email is sent to the user with a link to reset their password. Clicking the link leads the user to the |
|A form for the user to enter a new password. The user submits the new password and |
|An API route to update the new password for the user.|
|A form to activate the new user. The user should only reach this form from a link in their email. The user submits the password and |
|An API route to activate the user account.|
|An API route for creating a new address.|
|An API route for updating and deleting an address.|
|A page to view the details of an order. Requires the user to be authenticated.|
Configuring user authentication
You can configure user authentication with the following tasks:
- Retrieve a customer access token
- Tell bots not to index a page
- Learn how to manage customer accounts with the Storefront API.
- Get familiar with the file-based routing system that Hydrogen uses.
- Learn about the Hydrogen framework's built-in support for session management.
- Learn how to customize the output of SEO-related tags in your Hydrogen client and server components.