diff --git a/.github/pr-labeler.yml b/.github/pr-labeler.yml
index 03622666..618d4ccd 100644
--- a/.github/pr-labeler.yml
+++ b/.github/pr-labeler.yml
@@ -1,74 +1,26 @@
# https://github.com/actions/labeler#create-githublabeleryml
-
-test:
- - test/**/*
- - types/tests/**/*
-
-providers:
- - packages/next-auth/src/providers/**/*
- - test/integration/**/*
-
-adapters:
- - packages/next-auth/src/adapters.ts
- - packages/adapter-*/**
-
-dgraph:
- - packages/adapter-dgraph/**
-
-dynamodb:
- - packages/adapter-dynamodb/**
-
-fauna:
- - packages/adapter-fauna/**
-
-firebase:
- - packages/adapter-firebase/**
-
-mikro-orm:
- - packages/adapter-mikro-orm/**
-
-mongodb:
- - packages/adapter-mongodb/**
-
-neo4j:
- - packages/adapter-neo4j/**
-
-pouchdb:
- - packages/adapter-pouchdb/**
-
-prisma:
- - packages/adapter-prisma/**
-
-sequelize:
- - packages/adapter-sequelize/**
-
-supabase:
- - packages/adapter-supabase/**
-
-typeorm-legacy:
- - packages/adapter-typeorm-legacy/**
-
-upstash-redis:
- - packages/adapter-upstash-redis/**
-
-xata:
- - packages/adapter-xata/**
-
-core:
- - packages/next-auth/src/**/*
-
-style:
- - packages/next-auth/src/css/**/*
-
-client:
- - packages/next-auth/src/client/**/*
- - packages/next-auth/src/react/**/*
-
-pages:
- - packages/next-auth/src/core/pages/**/*
-
-TypeScript:
- - packages/next-auth/src/**/types.ts
-
-documentation:
- - packages/docs/docs/**/*
+adapters: ["packages/core/src/adapters.ts", "packages/adapter-*/**/*"]
+core: ["packages/core/src/**/*"]
+dgraph: ["packages/adapter-dgraph/**/*"]
+documentation: ["packages/docs/docs/**/*"]
+dynamodb: ["packages/adapter-dynamodb/**/*"]
+examples: ["apps/examples/**/*"]
+fauna: ["packages/adapter-fauna/**/*"]
+firebase: ["packages/adapter-firebase/**/*"]
+frameworks: ["packages/frameworks-*/**/*"]
+legacy: ["packages/next-auth/**/*"]
+mikro-orm: ["packages/adapter-mikro-orm/**/*"]
+mongodb: ["packages/adapter-mongodb/**/*"]
+neo4j: ["packages/adapter-neo4j/**/*"]
+playgrounds: ["apps/playgrounds/**/*"]
+pouchdb: ["packages/adapter-pouchdb/**/*"]
+prisma: ["packages/adapter-prisma/**/*"]
+providers: ["packages/core/src/providers/**/*"]
+sequelize: ["packages/adapter-sequelize/**/*"]
+solidjs: ["packages/frameworks-solid-start/**/*"]
+supabase: ["packages/adapter-supabase/**/*"]
+svelte: ["packages/frameworks-sveltekit/**/*"]
+test: ["**test**/*"]
+typeorm-legacy: ["packages/adapter-typeorm-legacy/**/*"]
+upstash-redis: ["packages/adapter-upstash-redis/**/*"]
+xata: ["packages/adapter-xata/**/*"]
diff --git a/.github/sync.yml b/.github/sync.yml
index 0bb0648e..9c033ca5 100644
--- a/.github/sync.yml
+++ b/.github/sync.yml
@@ -1,7 +1,7 @@
# Note that nextauthjs/next-auth-example syncs from the v4 branch
nextauthjs/sveltekit-auth-example:
- - source: apps/example-sveltekit
+ - source: apps/examples/sveltekit
dest: .
deleteOrphaned: true
- .github/FUNDING.yml
@@ -15,7 +15,7 @@ nextauthjs/solid-start-auth-example:
- LICENSE
nextauthjs/next-auth-gatsby-example:
- - source: apps/playground-gatsby
+ - source: apps/playgrounds/gatsby
dest: .
deleteOrphaned: true
- .github/FUNDING.yml
diff --git a/.gitignore b/.gitignore
index 810cec9b..b9541b8e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -86,6 +86,7 @@ packages/core/*.d.ts
packages/core/*.d.ts.map
packages/core/lib
packages/core/providers
+packages/core/src/lib/pages/styles.ts
docs/docs/reference/03-core
docs/docs/reference/04-sveltekit
diff --git a/apps/dev/.vscode/settings.json b/apps/dev/.vscode/settings.json
deleted file mode 100644
index 94a4cbdf..00000000
--- a/apps/dev/.vscode/settings.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "typescript.tsdk": "../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/lib",
- "typescript.enablePromptUseWorkspaceTsdk": true
-}
diff --git a/apps/dev/.env.local.example b/apps/dev/nextjs/.env.local.example
similarity index 100%
rename from apps/dev/.env.local.example
rename to apps/dev/nextjs/.env.local.example
diff --git a/apps/dev/nextjs/.vscode/settings.json b/apps/dev/nextjs/.vscode/settings.json
new file mode 100644
index 00000000..fd092f6c
--- /dev/null
+++ b/apps/dev/nextjs/.vscode/settings.json
@@ -0,0 +1,4 @@
+{
+ "typescript.tsdk": "../../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/lib",
+ "typescript.enablePromptUseWorkspaceTsdk": true
+}
\ No newline at end of file
diff --git a/apps/dev/README.md b/apps/dev/nextjs/README.md
similarity index 100%
rename from apps/dev/README.md
rename to apps/dev/nextjs/README.md
diff --git a/apps/dev/app/layout.tsx b/apps/dev/nextjs/app/layout.tsx
similarity index 100%
rename from apps/dev/app/layout.tsx
rename to apps/dev/nextjs/app/layout.tsx
diff --git a/apps/dev/app/server-component/page.tsx b/apps/dev/nextjs/app/server-component/page.tsx
similarity index 100%
rename from apps/dev/app/server-component/page.tsx
rename to apps/dev/nextjs/app/server-component/page.tsx
diff --git a/apps/dev/components/access-denied.js b/apps/dev/nextjs/components/access-denied.js
similarity index 100%
rename from apps/dev/components/access-denied.js
rename to apps/dev/nextjs/components/access-denied.js
diff --git a/apps/dev/components/footer.js b/apps/dev/nextjs/components/footer.js
similarity index 100%
rename from apps/dev/components/footer.js
rename to apps/dev/nextjs/components/footer.js
diff --git a/apps/dev/components/footer.module.css b/apps/dev/nextjs/components/footer.module.css
similarity index 100%
rename from apps/dev/components/footer.module.css
rename to apps/dev/nextjs/components/footer.module.css
diff --git a/apps/dev/components/header.js b/apps/dev/nextjs/components/header.js
similarity index 100%
rename from apps/dev/components/header.js
rename to apps/dev/nextjs/components/header.js
diff --git a/apps/dev/components/header.module.css b/apps/dev/nextjs/components/header.module.css
similarity index 100%
rename from apps/dev/components/header.module.css
rename to apps/dev/nextjs/components/header.module.css
diff --git a/apps/dev/components/layout.js b/apps/dev/nextjs/components/layout.js
similarity index 100%
rename from apps/dev/components/layout.js
rename to apps/dev/nextjs/components/layout.js
diff --git a/apps/dev/middleware.ts b/apps/dev/nextjs/middleware.ts
similarity index 100%
rename from apps/dev/middleware.ts
rename to apps/dev/nextjs/middleware.ts
diff --git a/apps/dev/next-env.d.ts b/apps/dev/nextjs/next-env.d.ts
similarity index 100%
rename from apps/dev/next-env.d.ts
rename to apps/dev/nextjs/next-env.d.ts
diff --git a/apps/dev/next.config.js b/apps/dev/nextjs/next.config.js
similarity index 100%
rename from apps/dev/next.config.js
rename to apps/dev/nextjs/next.config.js
diff --git a/apps/dev/package.json b/apps/dev/nextjs/package.json
similarity index 95%
rename from apps/dev/package.json
rename to apps/dev/nextjs/package.json
index fed06ee1..707d6c98 100644
--- a/apps/dev/package.json
+++ b/apps/dev/nextjs/package.json
@@ -1,7 +1,7 @@
{
"name": "next-auth-app",
"version": "1.0.0",
- "description": "NextAuth.js Developer app",
+ "description": "Next.js + Auth.js Developer app",
"private": true,
"scripts": {
"clean": "rm -rf .next",
diff --git a/apps/dev/pages/_app.js b/apps/dev/nextjs/pages/_app.js
similarity index 100%
rename from apps/dev/pages/_app.js
rename to apps/dev/nextjs/pages/_app.js
diff --git a/apps/dev/pages/api-example.js b/apps/dev/nextjs/pages/api-example.js
similarity index 100%
rename from apps/dev/pages/api-example.js
rename to apps/dev/nextjs/pages/api-example.js
diff --git a/apps/dev/pages/api/auth/[...nextauth].ts b/apps/dev/nextjs/pages/api/auth/[...nextauth].ts
similarity index 100%
rename from apps/dev/pages/api/auth/[...nextauth].ts
rename to apps/dev/nextjs/pages/api/auth/[...nextauth].ts
diff --git a/apps/dev/pages/api/examples/jwt.js b/apps/dev/nextjs/pages/api/examples/jwt.js
similarity index 100%
rename from apps/dev/pages/api/examples/jwt.js
rename to apps/dev/nextjs/pages/api/examples/jwt.js
diff --git a/apps/dev/pages/api/examples/protected.js b/apps/dev/nextjs/pages/api/examples/protected.js
similarity index 100%
rename from apps/dev/pages/api/examples/protected.js
rename to apps/dev/nextjs/pages/api/examples/protected.js
diff --git a/apps/dev/pages/api/examples/session.js b/apps/dev/nextjs/pages/api/examples/session.js
similarity index 100%
rename from apps/dev/pages/api/examples/session.js
rename to apps/dev/nextjs/pages/api/examples/session.js
diff --git a/apps/dev/pages/api/examples/supabase-rls.js b/apps/dev/nextjs/pages/api/examples/supabase-rls.js
similarity index 100%
rename from apps/dev/pages/api/examples/supabase-rls.js
rename to apps/dev/nextjs/pages/api/examples/supabase-rls.js
diff --git a/apps/dev/pages/client.js b/apps/dev/nextjs/pages/client.js
similarity index 100%
rename from apps/dev/pages/client.js
rename to apps/dev/nextjs/pages/client.js
diff --git a/apps/dev/pages/credentials.js b/apps/dev/nextjs/pages/credentials.js
similarity index 100%
rename from apps/dev/pages/credentials.js
rename to apps/dev/nextjs/pages/credentials.js
diff --git a/apps/dev/pages/email.js b/apps/dev/nextjs/pages/email.js
similarity index 100%
rename from apps/dev/pages/email.js
rename to apps/dev/nextjs/pages/email.js
diff --git a/apps/dev/pages/index.js b/apps/dev/nextjs/pages/index.js
similarity index 100%
rename from apps/dev/pages/index.js
rename to apps/dev/nextjs/pages/index.js
diff --git a/apps/dev/pages/middleware-protected/index.js b/apps/dev/nextjs/pages/middleware-protected/index.js
similarity index 100%
rename from apps/dev/pages/middleware-protected/index.js
rename to apps/dev/nextjs/pages/middleware-protected/index.js
diff --git a/apps/dev/pages/policy.js b/apps/dev/nextjs/pages/policy.js
similarity index 100%
rename from apps/dev/pages/policy.js
rename to apps/dev/nextjs/pages/policy.js
diff --git a/apps/dev/pages/protected-ssr.js b/apps/dev/nextjs/pages/protected-ssr.js
similarity index 100%
rename from apps/dev/pages/protected-ssr.js
rename to apps/dev/nextjs/pages/protected-ssr.js
diff --git a/apps/dev/pages/protected.js b/apps/dev/nextjs/pages/protected.js
similarity index 100%
rename from apps/dev/pages/protected.js
rename to apps/dev/nextjs/pages/protected.js
diff --git a/apps/dev/pages/server.js b/apps/dev/nextjs/pages/server.js
similarity index 100%
rename from apps/dev/pages/server.js
rename to apps/dev/nextjs/pages/server.js
diff --git a/apps/dev/pages/styles.css b/apps/dev/nextjs/pages/styles.css
similarity index 100%
rename from apps/dev/pages/styles.css
rename to apps/dev/nextjs/pages/styles.css
diff --git a/apps/dev/pages/supabase-client-rls.js b/apps/dev/nextjs/pages/supabase-client-rls.js
similarity index 100%
rename from apps/dev/pages/supabase-client-rls.js
rename to apps/dev/nextjs/pages/supabase-client-rls.js
diff --git a/apps/dev/pages/supabase-ssr.js b/apps/dev/nextjs/pages/supabase-ssr.js
similarity index 100%
rename from apps/dev/pages/supabase-ssr.js
rename to apps/dev/nextjs/pages/supabase-ssr.js
diff --git a/apps/dev/prisma/schema.prisma b/apps/dev/nextjs/prisma/schema.prisma
similarity index 100%
rename from apps/dev/prisma/schema.prisma
rename to apps/dev/nextjs/prisma/schema.prisma
diff --git a/apps/dev/tsconfig.json b/apps/dev/nextjs/tsconfig.json
similarity index 100%
rename from apps/dev/tsconfig.json
rename to apps/dev/nextjs/tsconfig.json
diff --git a/apps/dev/types/nextauth.d.ts b/apps/dev/nextjs/types/nextauth.d.ts
similarity index 100%
rename from apps/dev/types/nextauth.d.ts
rename to apps/dev/nextjs/types/nextauth.d.ts
diff --git a/apps/example-sveltekit/.env.example b/apps/dev/sveltekit/.env.example
similarity index 100%
rename from apps/example-sveltekit/.env.example
rename to apps/dev/sveltekit/.env.example
diff --git a/apps/example-sveltekit/.eslintignore b/apps/dev/sveltekit/.eslintignore
similarity index 100%
rename from apps/example-sveltekit/.eslintignore
rename to apps/dev/sveltekit/.eslintignore
diff --git a/apps/example-sveltekit/.eslintrc.cjs b/apps/dev/sveltekit/.eslintrc.cjs
similarity index 100%
rename from apps/example-sveltekit/.eslintrc.cjs
rename to apps/dev/sveltekit/.eslintrc.cjs
diff --git a/apps/example-sveltekit/.gitignore b/apps/dev/sveltekit/.gitignore
similarity index 100%
rename from apps/example-sveltekit/.gitignore
rename to apps/dev/sveltekit/.gitignore
diff --git a/apps/example-sveltekit/.prettierignore b/apps/dev/sveltekit/.prettierignore
similarity index 100%
rename from apps/example-sveltekit/.prettierignore
rename to apps/dev/sveltekit/.prettierignore
diff --git a/apps/example-sveltekit/.prettierrc b/apps/dev/sveltekit/.prettierrc
similarity index 100%
rename from apps/example-sveltekit/.prettierrc
rename to apps/dev/sveltekit/.prettierrc
diff --git a/apps/example-sveltekit/README.md b/apps/dev/sveltekit/README.md
similarity index 100%
rename from apps/example-sveltekit/README.md
rename to apps/dev/sveltekit/README.md
diff --git a/apps/dev/sveltekit/package.json b/apps/dev/sveltekit/package.json
new file mode 100644
index 00000000..07ab4c3b
--- /dev/null
+++ b/apps/dev/sveltekit/package.json
@@ -0,0 +1,26 @@
+{
+ "name": "sveltekit-auth-app",
+ "version": "1.0.0",
+ "description": "SvelteKit + Auth.js Developer app",
+ "private": true,
+ "scripts": {
+ "dev": "vite dev",
+ "build": "vite build",
+ "preview": "vite preview",
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
+ },
+ "devDependencies": {
+ "@sveltejs/adapter-auto": "next",
+ "@sveltejs/kit": "next",
+ "svelte": "3.55.0",
+ "svelte-check": "2.10.2",
+ "typescript": "4.9.4",
+ "vite": "4.0.1"
+ },
+ "dependencies": {
+ "@auth/core": "latest",
+ "@auth/sveltekit": "latest"
+ },
+ "type": "module"
+}
diff --git a/apps/example-sveltekit/src/app.d.ts b/apps/dev/sveltekit/src/app.d.ts
similarity index 100%
rename from apps/example-sveltekit/src/app.d.ts
rename to apps/dev/sveltekit/src/app.d.ts
diff --git a/apps/example-sveltekit/src/app.html b/apps/dev/sveltekit/src/app.html
similarity index 100%
rename from apps/example-sveltekit/src/app.html
rename to apps/dev/sveltekit/src/app.html
diff --git a/apps/example-sveltekit/src/hooks.server.ts b/apps/dev/sveltekit/src/hooks.server.ts
similarity index 100%
rename from apps/example-sveltekit/src/hooks.server.ts
rename to apps/dev/sveltekit/src/hooks.server.ts
diff --git a/apps/example-sveltekit/src/lib/SignInButton.svelte b/apps/dev/sveltekit/src/lib/SignInButton.svelte
similarity index 100%
rename from apps/example-sveltekit/src/lib/SignInButton.svelte
rename to apps/dev/sveltekit/src/lib/SignInButton.svelte
diff --git a/apps/example-sveltekit/src/routes/+layout.server.ts b/apps/dev/sveltekit/src/routes/+layout.server.ts
similarity index 100%
rename from apps/example-sveltekit/src/routes/+layout.server.ts
rename to apps/dev/sveltekit/src/routes/+layout.server.ts
diff --git a/apps/example-sveltekit/src/routes/+layout.svelte b/apps/dev/sveltekit/src/routes/+layout.svelte
similarity index 100%
rename from apps/example-sveltekit/src/routes/+layout.svelte
rename to apps/dev/sveltekit/src/routes/+layout.svelte
diff --git a/apps/example-sveltekit/src/routes/+page.svelte b/apps/dev/sveltekit/src/routes/+page.svelte
similarity index 100%
rename from apps/example-sveltekit/src/routes/+page.svelte
rename to apps/dev/sveltekit/src/routes/+page.svelte
diff --git a/apps/example-sveltekit/src/routes/protected/+page.svelte b/apps/dev/sveltekit/src/routes/protected/+page.svelte
similarity index 100%
rename from apps/example-sveltekit/src/routes/protected/+page.svelte
rename to apps/dev/sveltekit/src/routes/protected/+page.svelte
diff --git a/apps/example-sveltekit/static/favicon.ico b/apps/dev/sveltekit/static/favicon.ico
similarity index 100%
rename from apps/example-sveltekit/static/favicon.ico
rename to apps/dev/sveltekit/static/favicon.ico
diff --git a/apps/example-sveltekit/svelte.config.js b/apps/dev/sveltekit/svelte.config.js
similarity index 100%
rename from apps/example-sveltekit/svelte.config.js
rename to apps/dev/sveltekit/svelte.config.js
diff --git a/apps/example-sveltekit/tsconfig.json b/apps/dev/sveltekit/tsconfig.json
similarity index 100%
rename from apps/example-sveltekit/tsconfig.json
rename to apps/dev/sveltekit/tsconfig.json
diff --git a/apps/example-sveltekit/vite.config.js b/apps/dev/sveltekit/vite.config.js
similarity index 100%
rename from apps/example-sveltekit/vite.config.js
rename to apps/dev/sveltekit/vite.config.js
diff --git a/apps/example-nextjs/next-env.d.ts b/apps/example-nextjs/next-env.d.ts
deleted file mode 100644
index 4f11a03d..00000000
--- a/apps/example-nextjs/next-env.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-///
+ Open Source. Full Stack. Own Your Data. +
+ + + +# Documentation + +- [sveltekit.authjs.dev](https://sveltekit.authjs.dev) diff --git a/apps/example-sveltekit/package.json b/apps/examples/sveltekit/package.json similarity index 100% rename from apps/example-sveltekit/package.json rename to apps/examples/sveltekit/package.json diff --git a/apps/examples/sveltekit/src/app.d.ts b/apps/examples/sveltekit/src/app.d.ts new file mode 100644 index 00000000..d092fa60 --- /dev/null +++ b/apps/examples/sveltekit/src/app.d.ts @@ -0,0 +1 @@ +///+ This is an example site to demonstrate how to use SvelteKit + with SvelteKit Auth for authentication. +
diff --git a/apps/examples/sveltekit/src/routes/protected/+page.svelte b/apps/examples/sveltekit/src/routes/protected/+page.svelte new file mode 100644 index 00000000..b6364bed --- /dev/null +++ b/apps/examples/sveltekit/src/routes/protected/+page.svelte @@ -0,0 +1,19 @@ + + +{#if $page.data.session} ++ This is a protected content. You can access this content because you are + signed in. +
+Session expiry: {$page.data.session?.expires}
+{:else} ++ + You must be signed in to view this page + +
+{/if} diff --git a/apps/examples/sveltekit/static/favicon.ico b/apps/examples/sveltekit/static/favicon.ico new file mode 100644 index 00000000..825b9e65 Binary files /dev/null and b/apps/examples/sveltekit/static/favicon.ico differ diff --git a/apps/examples/sveltekit/svelte.config.js b/apps/examples/sveltekit/svelte.config.js new file mode 100644 index 00000000..87f198f5 --- /dev/null +++ b/apps/examples/sveltekit/svelte.config.js @@ -0,0 +1,15 @@ +import adapter from '@sveltejs/adapter-auto'; +import { vitePreprocess } from '@sveltejs/kit/vite'; + +/** @type {import('@sveltejs/kit').Config} */ +const config = { + // Consult https://kit.svelte.dev/docs/integrations#preprocessors + // for more information about preprocessors + preprocess: vitePreprocess(), + + kit: { + adapter: adapter() + } +}; + +export default config; diff --git a/apps/examples/sveltekit/tsconfig.json b/apps/examples/sveltekit/tsconfig.json new file mode 100644 index 00000000..2786bcb1 --- /dev/null +++ b/apps/examples/sveltekit/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true + } + // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias + // + // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes + // from the referenced tsconfig.json - TypeScript does not merge them in +} \ No newline at end of file diff --git a/apps/examples/sveltekit/vite.config.js b/apps/examples/sveltekit/vite.config.js new file mode 100644 index 00000000..8f67700c --- /dev/null +++ b/apps/examples/sveltekit/vite.config.js @@ -0,0 +1,8 @@ +import { sveltekit } from "@sveltejs/kit/vite" + +/** @type {import('vite').UserConfig} */ +const config = { + plugins: [sveltekit()], +} + +export default config diff --git a/apps/playground-gatsby/.env.example b/apps/playgrounds/gatsby/.env.example similarity index 100% rename from apps/playground-gatsby/.env.example rename to apps/playgrounds/gatsby/.env.example diff --git a/apps/playground-gatsby/.gitignore b/apps/playgrounds/gatsby/.gitignore similarity index 100% rename from apps/playground-gatsby/.gitignore rename to apps/playgrounds/gatsby/.gitignore diff --git a/apps/playground-gatsby/README.md b/apps/playgrounds/gatsby/README.md similarity index 100% rename from apps/playground-gatsby/README.md rename to apps/playgrounds/gatsby/README.md diff --git a/apps/playground-gatsby/api/auth/[nextauth].js b/apps/playgrounds/gatsby/api/auth/[nextauth].js similarity index 100% rename from apps/playground-gatsby/api/auth/[nextauth].js rename to apps/playgrounds/gatsby/api/auth/[nextauth].js diff --git a/apps/playground-gatsby/api/auth/[nextauth]/[provider].js b/apps/playgrounds/gatsby/api/auth/[nextauth]/[provider].js similarity index 100% rename from apps/playground-gatsby/api/auth/[nextauth]/[provider].js rename to apps/playgrounds/gatsby/api/auth/[nextauth]/[provider].js diff --git a/apps/playground-gatsby/gatsby-browser.js b/apps/playgrounds/gatsby/gatsby-browser.js similarity index 100% rename from apps/playground-gatsby/gatsby-browser.js rename to apps/playgrounds/gatsby/gatsby-browser.js diff --git a/apps/playground-gatsby/nextauth.config.js b/apps/playgrounds/gatsby/nextauth.config.js similarity index 100% rename from apps/playground-gatsby/nextauth.config.js rename to apps/playgrounds/gatsby/nextauth.config.js diff --git a/apps/playground-gatsby/package.json b/apps/playgrounds/gatsby/package.json similarity index 100% rename from apps/playground-gatsby/package.json rename to apps/playgrounds/gatsby/package.json diff --git a/apps/playground-gatsby/src/api/[...nextauth].js b/apps/playgrounds/gatsby/src/api/[...nextauth].js similarity index 100% rename from apps/playground-gatsby/src/api/[...nextauth].js rename to apps/playgrounds/gatsby/src/api/[...nextauth].js diff --git a/apps/playground-gatsby/src/components/layout.js b/apps/playgrounds/gatsby/src/components/layout.js similarity index 100% rename from apps/playground-gatsby/src/components/layout.js rename to apps/playgrounds/gatsby/src/components/layout.js diff --git a/apps/playground-gatsby/src/components/layout.module.css b/apps/playgrounds/gatsby/src/components/layout.module.css similarity index 100% rename from apps/playground-gatsby/src/components/layout.module.css rename to apps/playgrounds/gatsby/src/components/layout.module.css diff --git a/apps/playground-gatsby/src/pages/index.js b/apps/playgrounds/gatsby/src/pages/index.js similarity index 100% rename from apps/playground-gatsby/src/pages/index.js rename to apps/playgrounds/gatsby/src/pages/index.js diff --git a/apps/playground-gatsby/static/favicon.ico b/apps/playgrounds/gatsby/static/favicon.ico similarity index 100% rename from apps/playground-gatsby/static/favicon.ico rename to apps/playgrounds/gatsby/static/favicon.ico diff --git a/apps/playground-nuxt/.env.example b/apps/playgrounds/nuxt/.env.example similarity index 100% rename from apps/playground-nuxt/.env.example rename to apps/playgrounds/nuxt/.env.example diff --git a/apps/playground-nuxt/.eslintrc.cjs b/apps/playgrounds/nuxt/.eslintrc.cjs similarity index 100% rename from apps/playground-nuxt/.eslintrc.cjs rename to apps/playgrounds/nuxt/.eslintrc.cjs diff --git a/apps/playground-nuxt/.gitignore b/apps/playgrounds/nuxt/.gitignore similarity index 100% rename from apps/playground-nuxt/.gitignore rename to apps/playgrounds/nuxt/.gitignore diff --git a/apps/playground-nuxt/README.md b/apps/playgrounds/nuxt/README.md similarity index 100% rename from apps/playground-nuxt/README.md rename to apps/playgrounds/nuxt/README.md diff --git a/apps/playground-nuxt/app.vue b/apps/playgrounds/nuxt/app.vue similarity index 100% rename from apps/playground-nuxt/app.vue rename to apps/playgrounds/nuxt/app.vue diff --git a/apps/playground-nuxt/components/Header.vue b/apps/playgrounds/nuxt/components/Header.vue similarity index 100% rename from apps/playground-nuxt/components/Header.vue rename to apps/playgrounds/nuxt/components/Header.vue diff --git a/apps/playground-nuxt/composables/useSession.ts b/apps/playgrounds/nuxt/composables/useSession.ts similarity index 100% rename from apps/playground-nuxt/composables/useSession.ts rename to apps/playgrounds/nuxt/composables/useSession.ts diff --git a/apps/playground-nuxt/lib/auth/client.ts b/apps/playgrounds/nuxt/lib/auth/client.ts similarity index 100% rename from apps/playground-nuxt/lib/auth/client.ts rename to apps/playgrounds/nuxt/lib/auth/client.ts diff --git a/apps/playground-nuxt/lib/auth/server.ts b/apps/playgrounds/nuxt/lib/auth/server.ts similarity index 100% rename from apps/playground-nuxt/lib/auth/server.ts rename to apps/playgrounds/nuxt/lib/auth/server.ts diff --git a/apps/playground-nuxt/lib/auth/types.ts b/apps/playgrounds/nuxt/lib/auth/types.ts similarity index 100% rename from apps/playground-nuxt/lib/auth/types.ts rename to apps/playgrounds/nuxt/lib/auth/types.ts diff --git a/apps/playground-nuxt/nuxt.config.ts b/apps/playgrounds/nuxt/nuxt.config.ts similarity index 100% rename from apps/playground-nuxt/nuxt.config.ts rename to apps/playgrounds/nuxt/nuxt.config.ts diff --git a/apps/playground-nuxt/package.json b/apps/playgrounds/nuxt/package.json similarity index 100% rename from apps/playground-nuxt/package.json rename to apps/playgrounds/nuxt/package.json diff --git a/apps/playground-nuxt/pages/index.vue b/apps/playgrounds/nuxt/pages/index.vue similarity index 100% rename from apps/playground-nuxt/pages/index.vue rename to apps/playgrounds/nuxt/pages/index.vue diff --git a/apps/playground-nuxt/pages/protected.vue b/apps/playgrounds/nuxt/pages/protected.vue similarity index 100% rename from apps/playground-nuxt/pages/protected.vue rename to apps/playgrounds/nuxt/pages/protected.vue diff --git a/apps/playground-nuxt/plugins/auth.ts b/apps/playgrounds/nuxt/plugins/auth.ts similarity index 100% rename from apps/playground-nuxt/plugins/auth.ts rename to apps/playgrounds/nuxt/plugins/auth.ts diff --git a/apps/playground-nuxt/server/api/auth/[...].ts b/apps/playgrounds/nuxt/server/api/auth/[...].ts similarity index 100% rename from apps/playground-nuxt/server/api/auth/[...].ts rename to apps/playgrounds/nuxt/server/api/auth/[...].ts diff --git a/apps/playground-nuxt/tsconfig.json b/apps/playgrounds/nuxt/tsconfig.json similarity index 100% rename from apps/playground-nuxt/tsconfig.json rename to apps/playgrounds/nuxt/tsconfig.json diff --git a/package.json b/package.json index 56f9925c..ff6ea85c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "clean": "turbo run clean --no-cache", "dev:db": "turbo run dev --parallel --continue --filter=next-auth-app...", "dev": "turbo run dev --parallel --continue --filter=next-auth-app... --filter=!./packages/adapter-*", - "dev:kit": "turbo run dev --parallel --continue --filter=sveltekit-nextauth...", + "dev:kit": "turbo run dev --parallel --continue --filter=sveltekit-auth-app...", "dev:docs": "turbo run dev --filter=docs", "email": "cd apps/dev && pnpm email", "eslint": "eslint --cache .", diff --git a/packages/core/src/jwt.ts b/packages/core/src/jwt.ts index 0724eec0..ebde4c2b 100644 --- a/packages/core/src/jwt.ts +++ b/packages/core/src/jwt.ts @@ -41,6 +41,7 @@ import { EncryptJWT, jwtDecrypt } from "jose" import { SessionStore } from "./lib/cookie.js" import { Awaitable } from "./types.js" import type { LoggerInstance } from "./lib/utils/logger.js" +import { MissingSecret } from "./errors.js" const DEFAULT_MAX_AGE = 30 * 24 * 60 * 60 // 30 days @@ -97,13 +98,16 @@ export interface GetTokenParams {
* or updated (i.e whenever a session is accessed in the client).
* Its content is forwarded to the `session` callback,
* where you can control what should be returned to the client.
- * Anything else will be kept from your front-end.
+ * Anything else will be kept inaccessible from the client.
*
- * ⚠ By default the JWT is signed, but not encrypted.
+ * By default the JWT is encrypted.
*
* [Documentation](https://authjs.dev/guides/basics/callbacks#jwt-callback) |
* [`session` callback](https://authjs.dev/guides/basics/callbacks#session-callback)
diff --git a/packages/frameworks-sveltekit/src/lib/index.ts b/packages/frameworks-sveltekit/src/lib/index.ts
index d05af946..e7be566a 100644
--- a/packages/frameworks-sveltekit/src/lib/index.ts
+++ b/packages/frameworks-sveltekit/src/lib/index.ts
@@ -27,7 +27,7 @@
* })
* ```
*
- * Don't forget to set the `AUTH_SECRET` [environment variable](https://kit.svelte.dev/docs/modules#$env-static-private). This should be a random 32 character string. On unix systems you can use `openssl rand -hex 32` or check out `https://generate-secret.vercel.app/32`.
+ * Don't forget to set the `AUTH_SECRET` [environment variable](https://kit.svelte.dev/docs/modules#$env-dynamic-private). This should be a minimum of 32 characters, random string. On UNIX systems you can use `openssl rand -hex 32` or check out `https://generate-secret.vercel.app/32`.
*
* When deploying your app outside Vercel, set the `AUTH_TRUST_HOST` variable to `true` for other hosting providers like Cloudflare Pages or Netlify.
*
@@ -83,7 +83,6 @@ import type { Handle } from "@sveltejs/kit"
import { dev } from "$app/environment"
import { env } from "$env/dynamic/private"
-import { AUTH_SECRET } from "$env/static/private"
import { Auth } from "@auth/core"
import type { AuthAction, AuthConfig, Session } from "@auth/core/types"
@@ -92,7 +91,7 @@ export async function getSession(
req: Request,
config: AuthConfig
): ReturnType