Skip to content

Commit 0e6c51a

Browse files
committed
refactor: rename
1 parent c4352a7 commit 0e6c51a

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

packages/next-auth/src/core/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface NextAuthHeader {
2929
}
3030

3131
// TODO: Rename to `ResponseInternal`
32-
export interface OutgoingResponse<
32+
export interface ResponseInternal<
3333
Body extends string | Record<string, any> | any[] = any
3434
> {
3535
status?: number
@@ -46,7 +46,7 @@ async function AuthHandlerInternal<
4646
options: NextAuthOptions
4747
/** REVIEW: Is this the best way to skip parsing the body in Node.js? */
4848
parsedBody?: any
49-
}): Promise<OutgoingResponse<Body>> {
49+
}): Promise<ResponseInternal<Body>> {
5050
const { options: userOptions, req } = params
5151
setLogger(userOptions.logger, userOptions.debug)
5252

packages/next-auth/src/core/pages/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import ErrorPage from "./error"
66
import css from "../../css"
77

88
import type { InternalOptions } from "../types"
9-
import type { RequestInternal, OutgoingResponse } from ".."
9+
import type { RequestInternal, ResponseInternal } from ".."
1010
import type { Cookie } from "../lib/cookie"
1111
import type { ErrorType } from "./error"
1212

@@ -27,7 +27,7 @@ type RenderPageParams = {
2727
export default function renderPage(params: RenderPageParams) {
2828
const { url, theme, query, cookies } = params
2929

30-
function send({ html, title, status }: any): OutgoingResponse {
30+
function send({ html, title, status }: any): ResponseInternal {
3131
return {
3232
cookies,
3333
status,

packages/next-auth/src/core/routes/callback.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { hashToken } from "../lib/utils"
44
import getAdapterUserFromEmail from "../lib/email/getUserFromEmail"
55

66
import type { InternalOptions } from "../types"
7-
import type { RequestInternal, OutgoingResponse } from ".."
7+
import type { RequestInternal, ResponseInternal } from ".."
88
import type { Cookie, SessionStore } from "../lib/cookie"
99
import type { User } from "../.."
1010
import type { AdapterSession } from "../../adapters"
@@ -18,7 +18,7 @@ export default async function callback(params: {
1818
headers: RequestInternal["headers"]
1919
cookies: RequestInternal["cookies"]
2020
sessionStore: SessionStore
21-
}): Promise<OutgoingResponse> {
21+
}): Promise<ResponseInternal> {
2222
const { options, query, body, method, headers, sessionStore } = params
2323
const {
2424
provider,

packages/next-auth/src/core/routes/providers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { OutgoingResponse } from ".."
1+
import type { ResponseInternal } from ".."
22
import type { InternalProvider } from "../types"
33

44
export interface PublicProvider {
@@ -16,7 +16,7 @@ export interface PublicProvider {
1616
*/
1717
export default function providers(
1818
providers: InternalProvider[]
19-
): OutgoingResponse<Record<string, PublicProvider>> {
19+
): ResponseInternal<Record<string, PublicProvider>> {
2020
return {
2121
headers: [{ key: "Content-Type", value: "application/json" }],
2222
body: providers.reduce<Record<string, PublicProvider>>(

packages/next-auth/src/core/routes/session.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { fromDate } from "../lib/utils"
22

33
import type { Adapter } from "../../adapters"
44
import type { InternalOptions } from "../types"
5-
import type { OutgoingResponse } from ".."
5+
import type { ResponseInternal } from ".."
66
import type { Session } from "../.."
77
import type { SessionStore } from "../lib/cookie"
88

@@ -18,7 +18,7 @@ interface SessionParams {
1818

1919
export default async function session(
2020
params: SessionParams
21-
): Promise<OutgoingResponse<Session | {}>> {
21+
): Promise<ResponseInternal<Session | {}>> {
2222
const { options, sessionStore } = params
2323
const {
2424
adapter,
@@ -29,7 +29,7 @@ export default async function session(
2929
session: { strategy: sessionStrategy, maxAge: sessionMaxAge },
3030
} = options
3131

32-
const response: OutgoingResponse<Session | {}> = {
32+
const response: ResponseInternal<Session | {}> = {
3333
body: {},
3434
headers: [{ key: "Content-Type", value: "application/json" }],
3535
cookies: [],

packages/next-auth/src/core/routes/signin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import getAuthorizationUrl from "../lib/oauth/authorization-url"
22
import emailSignin from "../lib/email/signin"
33
import getAdapterUserFromEmail from "../lib/email/getUserFromEmail"
4-
import type { RequestInternal, OutgoingResponse } from ".."
4+
import type { RequestInternal, ResponseInternal } from ".."
55
import type { InternalOptions } from "../types"
66
import type { Account } from "../.."
77

@@ -10,7 +10,7 @@ export default async function signin(params: {
1010
options: InternalOptions<"oauth" | "email">
1111
query: RequestInternal["query"]
1212
body: RequestInternal["body"]
13-
}): Promise<OutgoingResponse> {
13+
}): Promise<ResponseInternal> {
1414
const { options, query, body } = params
1515
const { url, callbacks, logger, provider } = options
1616

packages/next-auth/src/core/routes/signout.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import type { Adapter } from "../../adapters"
22
import type { InternalOptions } from "../types"
3-
import type { OutgoingResponse } from ".."
3+
import type { ResponseInternal } from ".."
44
import type { SessionStore } from "../lib/cookie"
55

66
/** Handle requests to /api/auth/signout */
77
export default async function signout(params: {
88
options: InternalOptions
99
sessionStore: SessionStore
10-
}): Promise<OutgoingResponse> {
10+
}): Promise<ResponseInternal> {
1111
const { options, sessionStore } = params
1212
const { adapter, events, jwt, callbackUrl, logger, session } = options
1313

packages/next-auth/src/utils/web.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { serialize, parse as parseCookie } from "cookie"
2-
import type { OutgoingResponse, RequestInternal } from "../core"
2+
import type { ResponseInternal, RequestInternal } from "../core"
33
import type { NextAuthAction } from "../core/types"
44

55
const decoder = new TextDecoder()
@@ -68,7 +68,7 @@ export async function toInternalRequest(
6868
}
6969
}
7070

71-
export function toResponse(res: OutgoingResponse): Response {
71+
export function toResponse(res: ResponseInternal): Response {
7272
const headers = new Headers(
7373
res.headers?.reduce((acc, { key, value }) => {
7474
acc[key] = value

0 commit comments

Comments
 (0)