diff --git a/lib/build/recipe/oauth2provider/recipeImplementation.js b/lib/build/recipe/oauth2provider/recipeImplementation.js index 23936bbac..8428130ce 100644 --- a/lib/build/recipe/oauth2provider/recipeImplementation.js +++ b/lib/build/recipe/oauth2provider/recipeImplementation.js @@ -226,7 +226,7 @@ function getRecipeInterface( input.userContext ); if (resp.status === "OK") { - const redirectTo = resp.redirectTo; + const redirectTo = getUpdatedRedirectTo(appInfo, resp.redirectTo); if (redirectTo === undefined) { throw new Error(resp.body); } @@ -283,9 +283,9 @@ function getRecipeInterface( }, tokenExchange: async function (input) { var _a, _b; - const body = {}; + const inputBody = {}; for (const key in input.body) { - body[key] = input.body[key]; + inputBody[key] = input.body[key]; } if (input.body.grant_type === "refresh_token") { const scopes = @@ -330,7 +330,7 @@ function getRecipeInterface( scopes, userContext: input.userContext, }); - body["session"] = { + inputBody["session"] = { id_token: idToken, access_token: accessTokenPayload, }; @@ -338,11 +338,11 @@ function getRecipeInterface( } } if (input.authorizationHeader) { - body["authorizationHeader"] = input.authorizationHeader; + inputBody["authorizationHeader"] = input.authorizationHeader; } const res = await querier.sendPostRequest( new normalisedURLPath_1.default(`/recipe/oauth/token`), - { body, iss: await this.getIssuer({ userContext: input.userContext }) }, + { inputBody, iss: await this.getIssuer({ userContext: input.userContext }) }, input.userContext ); if (res.status !== "OK") { diff --git a/lib/ts/recipe/oauth2provider/recipeImplementation.ts b/lib/ts/recipe/oauth2provider/recipeImplementation.ts index fc1d9cc3d..538377ed8 100644 --- a/lib/ts/recipe/oauth2provider/recipeImplementation.ts +++ b/lib/ts/recipe/oauth2provider/recipeImplementation.ts @@ -202,7 +202,7 @@ export default function getRecipeInterface( ); if (resp.status === "OK") { - const redirectTo = resp.redirectTo; + const redirectTo = getUpdatedRedirectTo(appInfo, resp.redirectTo); if (redirectTo === undefined) { throw new Error(resp.body); } @@ -263,9 +263,9 @@ export default function getRecipeInterface( }, tokenExchange: async function (this: RecipeInterface, input) { - const body: any = {}; + const inputBody: any = {}; for (const key in input.body) { - body[key] = input.body[key]; + inputBody[key] = input.body[key]; } if (input.body.grant_type === "refresh_token") { @@ -309,7 +309,7 @@ export default function getRecipeInterface( scopes, userContext: input.userContext, }); - body["session"] = { + inputBody["session"] = { id_token: idToken, access_token: accessTokenPayload, }; @@ -319,12 +319,12 @@ export default function getRecipeInterface( } if (input.authorizationHeader) { - body["authorizationHeader"] = input.authorizationHeader; + inputBody["authorizationHeader"] = input.authorizationHeader; } const res = await querier.sendPostRequest( new NormalisedURLPath(`/recipe/oauth/token`), - { body, iss: await this.getIssuer({ userContext: input.userContext }) }, + { inputBody, iss: await this.getIssuer({ userContext: input.userContext }) }, input.userContext );