Skip to content

Repository files navigation

Astro Example

This is an example fork of how to use Better Auth with Astro. It uses Solid for building the components.

Implements the following features:

  • Email & Password
  • Social Sign-in with Google and Gitbub
  • Passkeys
  • Email Verification
  • Password Reset
  • Two Factor Authentication
  • Profile Update
  • Session Management

Differences from original

  1. Upgrades to astro v6 and tailwind v4.
    • Migrates legacy tailwind config file
    • WIP: Migrating tailwind plugins
    • WIP: Darkmode support.
  2. Adjusted .gitignore file

How to run

  1. Clone the code sandbox (or the repo) and open it in your code editor

  2. Provide .env file with the following variables

       GITHUB_CLIENT_ID=
       GITHUB_CLIENT_SECRET=
       GOOGLE_CLIENT_ID=
       GOOGLE_CLIENT_SECRET=
       BETTER_AUTH_SECRET=

    //if you don't have these, you can get them from the google developer console and github developer settings. If you don't want to use google or github sign-in, you can remove the config from the auth.ts file.

    Authorization callback URL
    Github: http://localhost:3000/api/auth/callback/github Google: http://localhost:3000/api/auth/callback/google

  3. Run the following commands

       bun i
       bun dev
  4. Open the browser and navigate to http://localhost:3000

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages