The challenge, should you choose to accept:
Use AuthKit to add authentication to this full-stack React Router application. Your app should allow users to register for a new account and log in using the following methods:
- Email + password
- Google OAuth
- GitHub OAuth
Good luck!
- Ensure you are using Node 22 or higher. The project will be deployed to Netlify using Node 22, so we recommend using the same version in development.
- Clone this repo and run
npm install
- Run
npm run copy-env
to generate a.env
file based on.env.example
- Create a new WorkOS account. If you already have an account you'd like to use you can sign-in.
- Go to your WorkOS dashboard
- Under the Quick start section, copy the
WORKOS_CLIENT_ID
andWORKOS_API_KEY
values and update the corresponding values in.env
- In your terminal, run
openssl rand -base64 32
to generate a random secret; copy this value and setWORKOS_COOKIE_PASSWORD
in.env
- Run the app with
npm run dev
NOTE: You may encounter the following error when running
npm run dev
:TypeError: Cannot read properties of null (reading 'useContext')
This is a bug in React Router that typically occurs on the first run. You can refresh the page and the error will go away.
Create a production build:
npm run build
To preview a production build locally, use the Netlify CLI:
npx netlify-cli serve
npm run build
This template is pre-configured for deployment to Netlify.
Follow https://docs.netlify.com/welcome/add-new-site/ to add this project as a site in your Netlify account.