mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
Compare commits
28 Commits
@auth/core
...
fix/callba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
079fbd27fa | ||
|
|
c7101981bc | ||
|
|
b0ecf4e861 | ||
|
|
5a73c6efa3 | ||
|
|
4aec142525 | ||
|
|
45f423ed5d | ||
|
|
2e52a89c52 | ||
|
|
ecde35e9c4 | ||
|
|
5a51330d55 | ||
|
|
b2db3eabee | ||
|
|
3865e44c1e | ||
|
|
9f5acc5749 | ||
|
|
0bbc8246b8 | ||
|
|
511f66b0a8 | ||
|
|
ae57199258 | ||
|
|
aad425fced | ||
|
|
8ef1010bb1 | ||
|
|
950ca3169a | ||
|
|
edbf0fc011 | ||
|
|
46bac818fe | ||
|
|
9e64eb0cdd | ||
|
|
955e379330 | ||
|
|
7be4461253 | ||
|
|
c2e06dc445 | ||
|
|
4dd70a5f6f | ||
|
|
98dbf56494 | ||
|
|
6b4644f7e7 | ||
|
|
f7b052a5fd |
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -8,7 +8,7 @@ merge of your pull request!
|
|||||||
> _NOTE_:
|
> _NOTE_:
|
||||||
>
|
>
|
||||||
> - It's a good idea to open an issue first to discuss potential changes.
|
> - It's a good idea to open an issue first to discuss potential changes.
|
||||||
> - Please make sure that you are _NOT_ opening a PR to fix a potential security vulnerability. Instead, please follow the [Security guidelines](../Security.md) to disclose the issue to us confidentially.
|
> - Please make sure that you are _NOT_ opening a PR to fix a potential security vulnerability. Instead, please follow the [Security guidelines](https://github.com/nextauthjs/.github/blob/main/SECURITY.md) to disclose the issue to us confidentially.
|
||||||
|
|
||||||
## ☕️ Reasoning
|
## ☕️ Reasoning
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ Fixes: INSERT_ISSUE_LINK_HERE
|
|||||||
|
|
||||||
## 📌 Resources
|
## 📌 Resources
|
||||||
|
|
||||||
- [Security guidelines](../Security.md)
|
- [Security guidelines](https://github.com/nextauthjs/.github/blob/main/SECURITY.md)
|
||||||
- [Contributing guidelines](../CONTRIBUTING.md)
|
- [Contributing guidelines](https://github.com/nextauthjs/.github/blob/main/CONTRIBUTING.md)
|
||||||
- [Code of conduct](../CODE_OF_CONDUCT.md)
|
- [Code of conduct](https://github.com/nextauthjs/.github/blob/main/CODE_OF_CONDUCT.md)
|
||||||
- [Contributing to Open Source](https://kcd.im/pull-request)
|
- [Contributing to Open Source](https://kcd.im/pull-request)
|
||||||
|
|||||||
98
.github/pr-labeler.yml
vendored
98
.github/pr-labeler.yml
vendored
@@ -1,74 +1,26 @@
|
|||||||
# https://github.com/actions/labeler#create-githublabeleryml
|
# https://github.com/actions/labeler#create-githublabeleryml
|
||||||
|
adapters: ["packages/core/src/adapters.ts", "packages/adapter-*/**/*"]
|
||||||
test:
|
core: ["packages/core/src/**/*"]
|
||||||
- test/**/*
|
dgraph: ["packages/adapter-dgraph/**/*"]
|
||||||
- types/tests/**/*
|
documentation: ["packages/docs/docs/**/*"]
|
||||||
|
dynamodb: ["packages/adapter-dynamodb/**/*"]
|
||||||
providers:
|
examples: ["apps/examples/**/*"]
|
||||||
- packages/next-auth/src/providers/**/*
|
fauna: ["packages/adapter-fauna/**/*"]
|
||||||
- test/integration/**/*
|
firebase: ["packages/adapter-firebase/**/*"]
|
||||||
|
frameworks: ["packages/frameworks-*/**/*"]
|
||||||
adapters:
|
legacy: ["packages/next-auth/**/*"]
|
||||||
- packages/next-auth/src/adapters.ts
|
mikro-orm: ["packages/adapter-mikro-orm/**/*"]
|
||||||
- packages/adapter-*/**
|
mongodb: ["packages/adapter-mongodb/**/*"]
|
||||||
|
neo4j: ["packages/adapter-neo4j/**/*"]
|
||||||
dgraph:
|
playgrounds: ["apps/playgrounds/**/*"]
|
||||||
- packages/adapter-dgraph/**
|
pouchdb: ["packages/adapter-pouchdb/**/*"]
|
||||||
|
prisma: ["packages/adapter-prisma/**/*"]
|
||||||
dynamodb:
|
providers: ["packages/core/src/providers/**/*"]
|
||||||
- packages/adapter-dynamodb/**
|
sequelize: ["packages/adapter-sequelize/**/*"]
|
||||||
|
solidjs: ["packages/frameworks-solid-start/**/*"]
|
||||||
fauna:
|
supabase: ["packages/adapter-supabase/**/*"]
|
||||||
- packages/adapter-fauna/**
|
svelte: ["packages/frameworks-sveltekit/**/*"]
|
||||||
|
test: ["**test**/*"]
|
||||||
firebase:
|
typeorm-legacy: ["packages/adapter-typeorm-legacy/**/*"]
|
||||||
- packages/adapter-firebase/**
|
upstash-redis: ["packages/adapter-upstash-redis/**/*"]
|
||||||
|
xata: ["packages/adapter-xata/**/*"]
|
||||||
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/**/*
|
|
||||||
|
|||||||
4
.github/sync.yml
vendored
4
.github/sync.yml
vendored
@@ -1,14 +1,14 @@
|
|||||||
# Note that nextauthjs/next-auth-example syncs from the v4 branch
|
# Note that nextauthjs/next-auth-example syncs from the v4 branch
|
||||||
|
|
||||||
nextauthjs/sveltekit-auth-example:
|
nextauthjs/sveltekit-auth-example:
|
||||||
- source: apps/example-sveltekit
|
- source: apps/examples/sveltekit
|
||||||
dest: .
|
dest: .
|
||||||
deleteOrphaned: true
|
deleteOrphaned: true
|
||||||
- .github/FUNDING.yml
|
- .github/FUNDING.yml
|
||||||
- LICENSE
|
- LICENSE
|
||||||
|
|
||||||
nextauthjs/next-auth-gatsby-example:
|
nextauthjs/next-auth-gatsby-example:
|
||||||
- source: apps/playground-gatsby
|
- source: apps/playgrounds/gatsby
|
||||||
dest: .
|
dest: .
|
||||||
deleteOrphaned: true
|
deleteOrphaned: true
|
||||||
- .github/FUNDING.yml
|
- .github/FUNDING.yml
|
||||||
|
|||||||
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@@ -29,9 +29,12 @@ jobs:
|
|||||||
run: pnpm install
|
run: pnpm install
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: pnpm test
|
run: pnpm test
|
||||||
|
timeout-minutes: 15
|
||||||
env:
|
env:
|
||||||
UPSTASH_REDIS_URL: ${{ secrets.UPSTASH_REDIS_URL }}
|
UPSTASH_REDIS_URL: ${{ secrets.UPSTASH_REDIS_URL }}
|
||||||
UPSTASH_REDIS_KEY: ${{ secrets.UPSTASH_REDIS_KEY }}
|
UPSTASH_REDIS_KEY: ${{ secrets.UPSTASH_REDIS_KEY }}
|
||||||
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||||
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||||
# - name: Coverage
|
# - name: Coverage
|
||||||
# uses: codecov/codecov-action@v1
|
# uses: codecov/codecov-action@v1
|
||||||
# with:
|
# with:
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -86,6 +86,7 @@ packages/core/*.d.ts
|
|||||||
packages/core/*.d.ts.map
|
packages/core/*.d.ts.map
|
||||||
packages/core/lib
|
packages/core/lib
|
||||||
packages/core/providers
|
packages/core/providers
|
||||||
|
packages/core/src/lib/pages/styles.ts
|
||||||
docs/docs/reference/03-core
|
docs/docs/reference/03-core
|
||||||
docs/docs/reference/04-sveltekit
|
docs/docs/reference/04-sveltekit
|
||||||
|
|
||||||
|
|||||||
4
apps/dev/.vscode/settings.json
vendored
4
apps/dev/.vscode/settings.json
vendored
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"typescript.tsdk": "../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/lib",
|
|
||||||
"typescript.enablePromptUseWorkspaceTsdk": true
|
|
||||||
}
|
|
||||||
4
apps/dev/nextjs/.vscode/settings.json
vendored
Normal file
4
apps/dev/nextjs/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"typescript.tsdk": "../../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/lib",
|
||||||
|
"typescript.enablePromptUseWorkspaceTsdk": true
|
||||||
|
}
|
||||||
@@ -3,4 +3,4 @@
|
|||||||
This folder contains a Next.js app using NextAuth.js for local development. See the following section on how to start:
|
This folder contains a Next.js app using NextAuth.js for local development. See the following section on how to start:
|
||||||
|
|
||||||
[Setting up local environment
|
[Setting up local environment
|
||||||
](https://github.com/nextauthjs/next-auth/blob/main/CONTRIBUTING.md#setting-up-local-environment)
|
](https://github.com/nextauthjs/.github/blob/main/CONTRIBUTING.md#setting-up-local-environment)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "next-auth-app",
|
"name": "next-auth-app",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "NextAuth.js Developer app",
|
"description": "Next.js + Auth.js Developer app",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .next",
|
"clean": "rm -rf .next",
|
||||||
@@ -1,4 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"name": "sveltekit-auth-app",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "SvelteKit + Auth.js Developer app",
|
||||||
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
@@ -2,9 +2,18 @@
|
|||||||
import { page } from "$app/stores"
|
import { page } from "$app/stores"
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{#if $page.data.session}
|
||||||
<h1>Protected page</h1>
|
<h1>Protected page</h1>
|
||||||
<p>
|
<p>
|
||||||
This is a protected content. You can access this content because you are
|
This is a protected content. You can access this content because you are
|
||||||
signed in.
|
signed in.
|
||||||
</p>
|
</p>
|
||||||
<p>Session expiry: {$page.data.session?.expires}</p>
|
<p>Session expiry: {$page.data.session?.expires}</p>
|
||||||
|
{:else}
|
||||||
|
<h1>Access Denied</h1>
|
||||||
|
<p>
|
||||||
|
<a href="/auth/signin">
|
||||||
|
You must be signed in to view this page
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
{/if}
|
||||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
5
apps/example-nextjs/next-env.d.ts
vendored
5
apps/example-nextjs/next-env.d.ts
vendored
@@ -1,5 +0,0 @@
|
|||||||
/// <reference types="next" />
|
|
||||||
/// <reference types="next/image-types/global" />
|
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
|
||||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import { redirect } from "@sveltejs/kit"
|
|
||||||
import type { PageLoad } from "./$types"
|
|
||||||
|
|
||||||
export const load: PageLoad = async ({ parent }) => {
|
|
||||||
const { session } = await parent()
|
|
||||||
if (!session?.user) {
|
|
||||||
throw redirect(302, "/")
|
|
||||||
}
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
5
apps/examples/sveltekit/.env.example
Normal file
5
apps/examples/sveltekit/.env.example
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
GITHUB_ID=
|
||||||
|
GITHUB_SECRET=
|
||||||
|
# On UNIX systems you can use `openssl rand -hex 32` or
|
||||||
|
# https://generate-secret.vercel.app/32 to generate a secret.
|
||||||
|
AUTH_SECRET=
|
||||||
13
apps/examples/sveltekit/.eslintignore
Normal file
13
apps/examples/sveltekit/.eslintignore
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/build
|
||||||
|
/.svelte-kit
|
||||||
|
/package
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
# Ignore files for PNPM, NPM and YARN
|
||||||
|
pnpm-lock.yaml
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
20
apps/examples/sveltekit/.eslintrc.cjs
Normal file
20
apps/examples/sveltekit/.eslintrc.cjs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
|
||||||
|
plugins: ['svelte3', '@typescript-eslint'],
|
||||||
|
ignorePatterns: ['*.cjs'],
|
||||||
|
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
|
||||||
|
settings: {
|
||||||
|
'svelte3/typescript': () => require('typescript')
|
||||||
|
},
|
||||||
|
parserOptions: {
|
||||||
|
sourceType: 'module',
|
||||||
|
ecmaVersion: 2020
|
||||||
|
},
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
es2017: true,
|
||||||
|
node: true
|
||||||
|
}
|
||||||
|
};
|
||||||
12
apps/examples/sveltekit/.gitignore
vendored
Normal file
12
apps/examples/sveltekit/.gitignore
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/build
|
||||||
|
/.svelte-kit
|
||||||
|
/package
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
.vercel
|
||||||
|
.output
|
||||||
|
vite.config.js.timestamp-*
|
||||||
|
vite.config.ts.timestamp-*
|
||||||
13
apps/examples/sveltekit/.prettierignore
Normal file
13
apps/examples/sveltekit/.prettierignore
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/build
|
||||||
|
/.svelte-kit
|
||||||
|
/package
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
# Ignore files for PNPM, NPM and YARN
|
||||||
|
pnpm-lock.yaml
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
6
apps/examples/sveltekit/.prettierrc
Normal file
6
apps/examples/sveltekit/.prettierrc
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"semi": false,
|
||||||
|
"plugins": ["prettier-plugin-svelte"],
|
||||||
|
"pluginSearchDirs": ["."],
|
||||||
|
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
||||||
|
}
|
||||||
28
apps/examples/sveltekit/README.md
Normal file
28
apps/examples/sveltekit/README.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
> The example repository is maintained from a [monorepo](https://github.com/nextauthjs/next-auth/tree/main/apps/example-sveltekit). Pull Requests should be opened against [`nextauthjs/next-auth`](https://github.com/nextauthjs/next-auth).
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<br/>
|
||||||
|
<a href="https://authjs.dev" target="_blank"><img width="150px" src="https://authjs.dev/img/logo/logo-sm.png" /></a>
|
||||||
|
<h3 align="center">Auth.js Example App with <a href="https://kit.svelte.dev">SvelteKit</a></h3>
|
||||||
|
<p align="center">
|
||||||
|
Open Source. Full Stack. Own Your Data.
|
||||||
|
</p>
|
||||||
|
<p align="center" style="align: center;">
|
||||||
|
<a href="https://npm.im/@auth/sveltekit">
|
||||||
|
<img alt="npm" src="https://img.shields.io/npm/v/@auth/sveltekit?color=green&label=@auth/sveltekit&style=flat-square">
|
||||||
|
</a>
|
||||||
|
<a href="https://bundlephobia.com/result?p=sveltekit-auth-example">
|
||||||
|
<img src="https://img.shields.io/bundlephobia/minzip/@auth/sveltekit?label=size&style=flat-square" alt="Bundle Size"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://www.npmtrends.com/@auth/sveltekit">
|
||||||
|
<img src="https://img.shields.io/npm/dm/@auth/sveltekit?label=%20downloads&style=flat-square" alt="Downloads" />
|
||||||
|
</a>
|
||||||
|
<a href="https://npm.im/next-auth">
|
||||||
|
<img src="https://img.shields.io/badge/TypeScript-blue?style=flat-square" alt="TypeScript" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# Documentation
|
||||||
|
|
||||||
|
- [sveltekit.authjs.dev](https://sveltekit.authjs.dev)
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user