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

fix(nextjs): Update params type with Promise as expected in Next.js 15 #12114

Merged
merged 3 commits into from
Nov 1, 2024
Merged
Changes from 2 commits
Commits
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
3 changes: 2 additions & 1 deletion packages/next-auth/src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// @ts-expect-error Next.js does not yet correctly use the `package.json#exports` field
import type { NextRequest } from "next/server"
import type { Awaitable } from "@auth/core/types"

Check warning on line 3 in packages/next-auth/src/lib/types.ts

View check run for this annotation

Codecov / codecov/patch

packages/next-auth/src/lib/types.ts#L3

Added line #L3 was not covered by tests

/**
* AppRouteHandlerFnContext is the context that is passed to the handler as the
* second argument.
*/
export type AppRouteHandlerFnContext = {
params?: Record<string, string | string[]>
params?: Awaitable<Record<string, string | string[]>>

Check warning on line 10 in packages/next-auth/src/lib/types.ts

View check run for this annotation

Codecov / codecov/patch

packages/next-auth/src/lib/types.ts#L10

Added line #L10 was not covered by tests

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
params?: Awaitable<Record<string, string | string[]>>
params: Awaitable<Record<string, string | string[]>>

}
/**
* Handler function for app routes. If a non-Response value is returned, an error
Expand Down
Loading