krankos / astro-lucia-auth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lucia + Astro demo

Setup

Install dependencies

pnpm i

Prisma

Migrate Prisma schema:

pnpm prisma migrate dev --name init

Github OAuth

Create a Github OAuth app and copy-paste client id and secret into .env.

Run

pnpm dev

Polyfill for Node.js

If you're using Node.js (v18 or below) for development or production, a polyfill is required! Replace astro dev with NODE_OPTIONS=--experimental-global-webcrypto astro dev etc in package.json or import lucia-auth/polyfill/node in lib/lucia.ts:

import "lucia-auth/polyfill/node";

export const auth = lucia({
	// ...
});

About


Languages

Language:Astro 48.4%Language:TypeScript 41.4%Language:CSS 6.2%Language:JavaScript 4.0%