Skip to content

Commit

Permalink
fix(ts): allow getToken in getServerSideProps (#4659)
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed May 31, 2022
1 parent 358b80d commit e4ee520
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/next-auth/src/jwt/index.ts
Expand Up @@ -2,7 +2,7 @@ import { EncryptJWT, jwtDecrypt } from "jose"
import hkdf from "@panva/hkdf"
import { v4 as uuid } from "uuid"
import { SessionStore } from "../core/lib/cookie"
import type { NextApiRequest } from "next"
import type { GetServerSidePropsContext, NextApiRequest } from "next"
import type { NextRequest } from "next/server"
import type { JWT, JWTDecodeParams, JWTEncodeParams, JWTOptions } from "./types"
import type { LoggerInstance } from ".."
Expand Down Expand Up @@ -38,7 +38,7 @@ export async function decode(params: JWTDecodeParams): Promise<JWT | null> {

export interface GetTokenParams<R extends boolean = false> {
/** The request containing the JWT either in the cookies or in the `Authorization` header. */
req: NextRequest | NextApiRequest
req: GetServerSidePropsContext["req"] | NextRequest | NextApiRequest
/**
* Use secure prefix for cookie name, unless URL in `NEXTAUTH_URL` is http://
* or not set (e.g. development or test instance) case use unprefixed name
Expand Down

0 comments on commit e4ee520

Please sign in to comment.