/express-authjs

An example setup project for Auth.js with Express and React/Angular

Primary LanguageTypeScript

Getting Started

Install dependencies

pnpm install

Add necessary environment variables in .env in packages/api

AUTH_SECRET=

AUTH_GOOGLE_ID=
AUTH_GOOGLE_SECRET=

To generate AUTH_SECRET on Unix systems you can use command below or check out https://generate-secret.vercel.app/32.

openssl rand -hex 32

To get the AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET go to Google Developer Console. If you need help check this article.

Add authorized redirect URIs.

http://localhost:3000/api/auth/callback/google # server
http://localhost:5173/api/auth/callback/google # react
http://localhost:4200/api/auth/callback/google # angular
This is experimental and not production ready.