-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web): expose Web API compatible version of
next-auth
(#5536)
* WIP use `Request` and `Response` for core * bump Next.js * rename ts types * refactor * simplify * upgrade Next.js * implement body reader * use `Request`/`Response` in `next-auth/next` * make linter happy * revert * fix tests * remove workaround for middleware return type * return session in protected api route example * don't export internal handler * fall back host to localhost * refactor `getBody` * refactor `next-auth/next` * chore: add `@edge-runtime/jest-environment` * fix tests, using Node 18 as runtime * fix test * remove patch * upgrade/add dependencies * type and default import on one line * don't import all adapters by default in dev * simplify internal endpoint config Instead of passing url and params around as a string and an object, we parse them into a `URL` instance. * assert if both endpoint and issuer config is missing * allow internal redirect to be `URL` * mark clientId as always internally, fix comments * add web-compatible authorization URL handling * fix type * fix neo4j build * remove new-line * reduce file changes in the PR * simplify types * refactor `crypto` usage In Node.js, inject `globalThis.crypto` instead of import * add `next-auth/web` * refactor * send header instead of body to indicate redirect response * fix eslint * fix tests * chore: upgrade dep * fix import * refactor: more renames * wip core * support OIDC * remove `openid-client` * temprarily remove duplicate logos * revert * move redirect logic to core * wip fix css * revert Logo component * output ESM * fix logout * deprecate OAuth 1, simplify internals, improve defaults * refactor providers, test facebook * fix providers * target es2020 * fix CSS * update lock file * make logos optional * sync with `next-auth` * clean up `next-auth/edge` * sync * remove uuid * make secret required in dev * remove todo comments * pass through OAuth client options * generate declaration map * default env secret to AUTH_SECRET * temporary Headers fix * move pages to lib * move errors to lib * move pages/index to lib * move routes to lib * move init to lib * move styles to lib * move types to lib * move utils to lib * fix imports * update ignore/clean patterns * fix imports * update styles ts * update gitignore * update exports field * revert `next-auth` * remove extra tsconfig files * remove `private` from package.json * remove unused file, expose type * move gitignore, reduce exposed types * add back tsconfig files * remove leftover * revert gitignore * remove test script
- Loading branch information
1 parent
092ab9c
commit a7b6a29
Showing
115 changed files
with
9,531 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"name": "@auth/core", | ||
"version": "0.0.0", | ||
"description": "Authentication for the web.", | ||
"homepage": "https://next-auth.js.org", | ||
"repository": "https://github.com/nextauthjs/next-auth.git", | ||
"author": "Balázs Orbán <info@balazsorban.com>", | ||
"contributors": [ | ||
"Balázs Orbán <info@balazsorban.com>", | ||
"Nico Domino <yo@ndo.dev>", | ||
"Lluis Agusti <hi@llu.lu>", | ||
"Thang Huu Vu <thvu@hey.com>", | ||
"Iain Collins <me@iaincollins.com" | ||
], | ||
"type": "module", | ||
"types": "./index.d.ts", | ||
"files": [ | ||
"adapters.*", | ||
"index.*", | ||
"jwt", | ||
"lib", | ||
"providers", | ||
"src" | ||
], | ||
"exports": { | ||
".": { | ||
"types": "./index.d.ts", | ||
"import": "./index.js" | ||
}, | ||
"./adapters": { | ||
"types": "./adapters.d.ts" | ||
}, | ||
"./jwt": { | ||
"types": "./jwt/index.d.ts", | ||
"import": "./jwt/index.js" | ||
}, | ||
"./providers/*": { | ||
"types": "./providers/*.d.ts", | ||
"import": "./providers/*.js" | ||
} | ||
}, | ||
"license": "ISC", | ||
"dependencies": { | ||
"@panva/hkdf": "1.0.2", | ||
"cookie": "0.5.0", | ||
"jose": "4.11.1", | ||
"oauth4webapi": "2.0.4", | ||
"preact": "10.11.3", | ||
"preact-render-to-string": "5.2.3" | ||
}, | ||
"peerDependencies": { | ||
"nodemailer": "6.8.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
"nodemailer": { | ||
"optional": true | ||
} | ||
}, | ||
"scripts": { | ||
"build": "pnpm clean && tsc && pnpm css", | ||
"clean": "rm -rf adapters.* index.* jwt lib providers", | ||
"css": "node ./scripts/generate-css.js", | ||
"dev": "pnpm css && tsc -w" | ||
}, | ||
"devDependencies": { | ||
"@next-auth/tsconfig": "workspace:*", | ||
"@types/node": "18.11.10", | ||
"@types/nodemailer": "6.4.6", | ||
"@types/react": "18.0.26", | ||
"autoprefixer": "10.4.13", | ||
"cssnano": "5.1.14", | ||
"postcss": "8.4.19", | ||
"postcss-nested": "6.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import fs from "fs" | ||
import path from "path" | ||
import postcss from "postcss" | ||
|
||
import autoprefixer from "autoprefixer" | ||
import postCssNested from "postcss-nested" | ||
import cssNano from "cssnano" | ||
|
||
const from = path.join(process.cwd(), "src/lib/styles/index.css") | ||
const css = fs.readFileSync(from) | ||
|
||
const processedCss = await postcss([ | ||
autoprefixer, | ||
postCssNested, | ||
cssNano({ preset: "default" }), | ||
]).process(css, { from }) | ||
|
||
fs.writeFileSync( | ||
path.join(process.cwd(), "src/lib/styles/index.ts"), | ||
`export default \`${processedCss.css}\` | ||
// Generated by \`pnpm css\`` | ||
) |
Oops, something went wrong.