diff --git a/.circleci/forceRunCI.sh b/.circleci/forceRunCI.sh index f8088f23e..41e2a62e9 100755 --- a/.circleci/forceRunCI.sh +++ b/.circleci/forceRunCI.sh @@ -4,9 +4,9 @@ branch=`git rev-parse --abbrev-ref HEAD` cdiCoreMap='{ "5.2": "feat/oauth/remaining-changes" }' cdiPluginInterfaceMap='{ "5.2": "feat/oauth/remaining-changes" }' -fdiNodeMap='{ "3.1": "21.0", "4.0": "21.0" }' +fdiNodeMap='{ "3.1": "feat/add_clientId_secret_and_refreshTokenRotation_settings", "4.0": "feat/add_clientId_secret_and_refreshTokenRotation_settings" }' fdiWebsiteMap='{ "1.17": "20.1", "1.18": "20.1", "1.19": "20.1", "2.0": "20.1", "3.0": "20.1", "3.1": "20.1", "4.0": "20.1" }' -fdiAuthReactMap='{ "3.1": "0.49", "4.0": "0.49" }' +fdiAuthReactMap='{ "3.1": "0.48", "4.0": "0.48" }' data=`jq -cn --arg branch "$branch" \ --arg cdiCoreMap "$cdiCoreMap" \ diff --git a/lib/build/recipe/oauth2provider/api/loginInfo.js b/lib/build/recipe/oauth2provider/api/loginInfo.js index 15b9da808..d0572e82c 100644 --- a/lib/build/recipe/oauth2provider/api/loginInfo.js +++ b/lib/build/recipe/oauth2provider/api/loginInfo.js @@ -22,7 +22,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const utils_1 = require("../../../utils"); const error_1 = __importDefault(require("../../../error")); async function loginInfoGET(apiImplementation, options, userContext) { - var _a; + var _a, _b; if (apiImplementation.loginInfoGET === undefined) { return false; } @@ -41,7 +41,14 @@ async function loginInfoGET(apiImplementation, options, userContext) { loginChallenge, userContext, }); - utils_1.send200Response(options.res, response); + if ("error" in response) { + utils_1.sendNon200Response(options.res, (_b = response.statusCode) !== null && _b !== void 0 ? _b : 400, { + error: response.error, + error_description: response.errorDescription, + }); + } else { + utils_1.send200Response(options.res, response); + } return true; } exports.default = loginInfoGET; diff --git a/lib/ts/recipe/oauth2provider/api/loginInfo.ts b/lib/ts/recipe/oauth2provider/api/loginInfo.ts index 2c13ddad0..91bb5a0c3 100644 --- a/lib/ts/recipe/oauth2provider/api/loginInfo.ts +++ b/lib/ts/recipe/oauth2provider/api/loginInfo.ts @@ -13,7 +13,7 @@ * under the License. */ -import { send200Response } from "../../../utils"; +import { send200Response, sendNon200Response } from "../../../utils"; import { APIInterface, APIOptions } from ".."; import { UserContext } from "../../../types"; import SuperTokensError from "../../../error"; @@ -43,6 +43,14 @@ export default async function loginInfoGET( userContext, }); - send200Response(options.res, response); + if ("error" in response) { + sendNon200Response(options.res, response.statusCode ?? 400, { + error: response.error, + error_description: response.errorDescription, + }); + } else { + send200Response(options.res, response); + } + return true; } diff --git a/lib/ts/recipe/oauth2provider/types.ts b/lib/ts/recipe/oauth2provider/types.ts index 63488692b..e73880482 100644 --- a/lib/ts/recipe/oauth2provider/types.ts +++ b/lib/ts/recipe/oauth2provider/types.ts @@ -136,8 +136,7 @@ export type LoginRequest = { export type TokenInfo = { // The access token issued by the authorization server. access_token?: string; - // The lifetime in seconds of the access token. For example, the value "3600" denotes that the access token will expire in one hour from the time the response was generated. - // integer + // The lifetime in seconds of the access token (integer). For example, the value "3600" denotes that the access token will expire in one hour from the time the response was generated. expires_in: number; // To retrieve a refresh token request the id_token scope. id_token?: string;