Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): expose Web API compatible version of next-auth #5536

Merged
merged 113 commits into from
Dec 13, 2022
Merged
Changes from 1 commit
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
e428b17
WIP use `Request` and `Response` for core
balazsorban44 Jun 26, 2022
1268301
Merge branch 'main' into chore/core-request-response
balazsorban44 Aug 11, 2022
8c21589
bump Next.js
balazsorban44 Aug 11, 2022
504f384
rename ts types
balazsorban44 Aug 11, 2022
c736948
refactor
balazsorban44 Aug 11, 2022
b274e98
simplify
balazsorban44 Aug 11, 2022
b933003
upgrade Next.js
balazsorban44 Aug 12, 2022
db6b1c9
implement body reader
balazsorban44 Aug 12, 2022
fe9c6a5
use `Request`/`Response` in `next-auth/next`
balazsorban44 Aug 12, 2022
bc9ddae
make linter happy
balazsorban44 Aug 12, 2022
a5cd972
revert
balazsorban44 Aug 12, 2022
2cf11bb
fix tests
balazsorban44 Aug 12, 2022
63cdea4
remove workaround for middleware return type
balazsorban44 Aug 12, 2022
eb77e23
Merge branch 'main' into chore/core-request-response
balazsorban44 Oct 5, 2022
1903e3c
return session in protected api route example
balazsorban44 Oct 5, 2022
b63e843
don't export internal handler
balazsorban44 Oct 5, 2022
07ab4f8
fall back host to localhost
balazsorban44 Oct 5, 2022
415d299
refactor `getBody`
balazsorban44 Oct 5, 2022
b41bdeb
refactor `next-auth/next`
balazsorban44 Oct 5, 2022
8f7288a
Merge branch 'main' into chore/core-request-response
balazsorban44 Oct 6, 2022
bd4d78b
chore: add `@edge-runtime/jest-environment`
balazsorban44 Oct 6, 2022
1a2e752
fix tests, using Node 18 as runtime
balazsorban44 Oct 6, 2022
195822c
fix test
balazsorban44 Oct 6, 2022
57a7d3f
remove patch
balazsorban44 Oct 7, 2022
3d14536
upgrade/add dependencies
balazsorban44 Oct 8, 2022
bc314ef
type and default import on one line
balazsorban44 Oct 8, 2022
0723747
don't import all adapters by default in dev
balazsorban44 Oct 8, 2022
b8ed735
simplify internal endpoint config
balazsorban44 Oct 8, 2022
9bea473
assert if both endpoint and issuer config is missing
balazsorban44 Oct 8, 2022
cbd7f18
allow internal redirect to be `URL`
balazsorban44 Oct 8, 2022
9466f65
mark clientId as always internally, fix comments
balazsorban44 Oct 9, 2022
dbf4293
add web-compatible authorization URL handling
balazsorban44 Oct 9, 2022
0c71f26
fix type
balazsorban44 Oct 9, 2022
5d6643b
Merge branch 'main' into chore/core-request-response
balazsorban44 Oct 9, 2022
0e635bd
Merge remote-tracking branch 'origin/chore/core-request-response' int…
balazsorban44 Oct 9, 2022
1bed118
fix neo4j build
balazsorban44 Oct 10, 2022
4a2c89d
Merge remote-tracking branch 'origin/chore/core-request-response' int…
balazsorban44 Oct 10, 2022
6843007
Merge branch 'main' into chore/core-request-response
balazsorban44 Oct 10, 2022
6d3e4af
Merge remote-tracking branch 'origin/chore/core-request-response' int…
balazsorban44 Oct 10, 2022
b2de56c
remove new-line
balazsorban44 Oct 10, 2022
8041a59
reduce file changes in the PR
balazsorban44 Oct 10, 2022
49cfcf1
Merge remote-tracking branch 'origin/chore/core-request-response' int…
balazsorban44 Oct 10, 2022
7b46d1a
simplify types
balazsorban44 Oct 10, 2022
79d6299
refactor `crypto` usage
balazsorban44 Oct 10, 2022
68d5387
add `next-auth/web`
balazsorban44 Oct 10, 2022
a063349
refactor
balazsorban44 Oct 10, 2022
697443d
send header instead of body to indicate redirect response
balazsorban44 Oct 10, 2022
119de7e
fix eslint
balazsorban44 Oct 10, 2022
7a47d68
fix tests
balazsorban44 Oct 10, 2022
9aaa058
Merge branch 'main' into feat/oauth4webapi-balazs
balazsorban44 Dec 3, 2022
b0b9939
Merge branch 'main' into feat/oauth4webapi-balazs
balazsorban44 Dec 3, 2022
6b46f37
chore: upgrade dep
balazsorban44 Dec 3, 2022
b0fb174
Merge branch 'main' into feat/oauth4webapi-balazs
balazsorban44 Dec 3, 2022
1ee62b6
Merge branch 'main' into feat/oauth4webapi-balazs
balazsorban44 Dec 3, 2022
5a22790
fix import
balazsorban44 Dec 3, 2022
9f3e33e
refactor: more renames
balazsorban44 Dec 5, 2022
40f11ed
Merge branch 'main' into feat/oauth4webapi-balazs
balazsorban44 Dec 5, 2022
7d8f468
Merge branch 'main' into feat/oauth4webapi-balazs
balazsorban44 Dec 5, 2022
9d079a5
wip core
balazsorban44 Dec 6, 2022
166d4a8
support OIDC
balazsorban44 Dec 6, 2022
cc098bd
remove `openid-client`
balazsorban44 Dec 6, 2022
808d9a2
temprarily remove duplicate logos
balazsorban44 Dec 7, 2022
99abfbe
revert
balazsorban44 Dec 7, 2022
8299b97
move redirect logic to core
balazsorban44 Dec 7, 2022
2730249
wip fix css
balazsorban44 Dec 7, 2022
598b3ef
revert Logo component
balazsorban44 Dec 7, 2022
c3932f1
Merge branch 'main' into feat/oauth4webapi-balazs
balazsorban44 Dec 7, 2022
df61660
output ESM
balazsorban44 Dec 8, 2022
104f944
fix logout
balazsorban44 Dec 8, 2022
5c96c8f
deprecate OAuth 1, simplify internals, improve defaults
balazsorban44 Dec 8, 2022
5945d9b
refactor providers, test facebook
balazsorban44 Dec 8, 2022
5633959
fix providers
balazsorban44 Dec 8, 2022
860c8b5
target es2020
balazsorban44 Dec 8, 2022
187d38b
fix CSS
balazsorban44 Dec 8, 2022
7444ab3
Merge branch 'main' into feat/oauth4webapi-balazs
balazsorban44 Dec 8, 2022
7f3a6ca
Merge branch 'main' into feat/oauth4webapi-balazs
balazsorban44 Dec 11, 2022
0b8d3fd
update lock file
balazsorban44 Dec 11, 2022
67c525b
Merge branch 'main' into feat/oauth4webapi-balazs
balazsorban44 Dec 12, 2022
fa864e1
make logos optional
balazsorban44 Dec 12, 2022
92cfb91
sync with `next-auth`
balazsorban44 Dec 12, 2022
0469fc6
clean up `next-auth/edge`
balazsorban44 Dec 12, 2022
73026a4
sync
balazsorban44 Dec 12, 2022
5d15ac5
remove uuid
balazsorban44 Dec 13, 2022
e651df5
make secret required in dev
balazsorban44 Dec 13, 2022
9d0c138
remove todo comments
balazsorban44 Dec 13, 2022
e9f0828
pass through OAuth client options
balazsorban44 Dec 13, 2022
f231016
generate declaration map
balazsorban44 Dec 13, 2022
b2e66cc
default env secret to AUTH_SECRET
balazsorban44 Dec 13, 2022
f2d193b
temporary Headers fix
balazsorban44 Dec 13, 2022
90df63e
move pages to lib
balazsorban44 Dec 13, 2022
c229183
move errors to lib
balazsorban44 Dec 13, 2022
ffee34d
move pages/index to lib
balazsorban44 Dec 13, 2022
d96947c
move routes to lib
balazsorban44 Dec 13, 2022
1d9e591
move init to lib
balazsorban44 Dec 13, 2022
cb5a2ad
move styles to lib
balazsorban44 Dec 13, 2022
3e3f9a9
move types to lib
balazsorban44 Dec 13, 2022
0939b13
move utils to lib
balazsorban44 Dec 13, 2022
9fcf854
fix imports
balazsorban44 Dec 13, 2022
cea5969
update ignore/clean patterns
balazsorban44 Dec 13, 2022
24f329a
fix imports
balazsorban44 Dec 13, 2022
249ebf4
update styles ts
balazsorban44 Dec 13, 2022
2c209d7
update gitignore
balazsorban44 Dec 13, 2022
4582348
update exports field
balazsorban44 Dec 13, 2022
fef8457
revert `next-auth`
balazsorban44 Dec 13, 2022
ced1ca4
remove extra tsconfig files
balazsorban44 Dec 13, 2022
369a27b
remove `private` from package.json
balazsorban44 Dec 13, 2022
df061b9
remove unused file, expose type
balazsorban44 Dec 13, 2022
18b8247
move gitignore, reduce exposed types
balazsorban44 Dec 13, 2022
6c098d7
add back tsconfig files
balazsorban44 Dec 13, 2022
1d1dfb7
remove leftover
balazsorban44 Dec 13, 2022
c2e40f0
Merge branch 'main' into feat/oauth4webapi-balazs
balazsorban44 Dec 13, 2022
34e4471
revert gitignore
balazsorban44 Dec 13, 2022
ef3dbfb
remove test script
balazsorban44 Dec 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove workaround for middleware return type
  • Loading branch information
balazsorban44 committed Aug 12, 2022
commit 63cdea45066e7d3a52cae4cc820b65057f3f347d
8 changes: 2 additions & 6 deletions packages/next-auth/src/next/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,10 @@ export interface NextAuthMiddlewareOptions {
secret?: string
}

// TODO: `NextMiddleware` should allow returning `void`
// Simplify when https://github.com/vercel/next.js/pull/38625 is merged.
type NextMiddlewareResult = ReturnType<NextMiddleware> | void // eslint-disable-line @typescript-eslint/no-invalid-void-type

async function handleMiddleware(
req: NextRequest,
options: NextAuthMiddlewareOptions | undefined,
onSuccess?: (token: JWT | null) => Promise<NextMiddlewareResult>
onSuccess?: (token: JWT | null) => ReturnType<NextMiddleware>
) {
const { pathname, search, origin } = req.nextUrl

Expand Down Expand Up @@ -156,7 +152,7 @@ export interface NextRequestWithAuth extends NextRequest {
export type NextMiddlewareWithAuth = (
request: NextRequestWithAuth,
event: NextFetchEvent
) => NextMiddlewareResult | Promise<NextMiddlewareResult>
) => ReturnType<NextMiddleware>

export type WithAuthArgs =
| [NextRequestWithAuth]
Expand Down