Skip to content

Files

Latest commit

7fe9ebe · Dec 21, 2023

History

History

express-auth

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Dec 21, 2023
Dec 21, 2023
Dec 21, 2023
Dec 21, 2023
Dec 21, 2023
Dec 21, 2023
Dec 21, 2023
Dec 21, 2023
Dec 21, 2023
Dec 21, 2023
Dec 21, 2023
Dec 21, 2023
Dec 21, 2023

Express with EdgeDB Auth

  • builtin.ts shows how to use the built-in UI using the route factory method.
  • custom.ts shows how to build your own UI using the manual router method.

Setup

  1. Run edgedb project initand follow the prompts
  2. Run npm install
  3. Run edgedb ui
  4. Click into the edgedb database and switch to the "Auth Admin" section (nested shield icon in the left-hand toolbar)
  5. Enter a value for auth_signing_key or click the button nested in the field to generate one and click the "Update" button
  6. Enter http://localhost:3333/ in the allowed_redirect_urls field and click "Update"
  7. Switch to the "Providers" tab
  8. Click "Add Provider," select and configure a provider, and click "Add Provider" to save the new provider
  9. (Built-in only) Click "Enable" under "Login UI"
  10. (Built-in only) Set the value for redirect_to to http://localhost:3333/auth/callback and click "Update"

Note: If you configured the "Email + Password" provider to require verification, the example app will need a way to send emails. You might try running Mailpit to do this for local testing. We share how in our EdgeDB Auth guide.

Usage

npm run builtin
# or
npm run custom