From 1ff3d1abd2b37c5faf7d7fea559609dc84ee3f17 Mon Sep 17 00:00:00 2001 From: Nemi Shah Date: Sat, 25 Feb 2023 11:13:23 +0530 Subject: [PATCH] refactor: Use auth mode instead of manually checking for api key in config (#494) * Use auth mode instead of manually checking for api key in config * Update package version * Update CHANGELOG --- CHANGELOG.md | 4 ++++ lib/build/recipe/dashboard/api/signOut.js | 2 +- lib/build/version.d.ts | 2 +- lib/build/version.js | 2 +- lib/ts/recipe/dashboard/api/signOut.ts | 2 +- lib/ts/version.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9263c98aa..656aeb33d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] +## [13.1.1] - 2023-02-24 + +- Refactor dashboard recipe to use auth mode instead of manually checking for api key + ## [13.1.0] - 2023-02-22 - Adds APIs and logic to the dashboard recipe to enable email password based login diff --git a/lib/build/recipe/dashboard/api/signOut.js b/lib/build/recipe/dashboard/api/signOut.js index 6d480b738..929caddbe 100644 --- a/lib/build/recipe/dashboard/api/signOut.js +++ b/lib/build/recipe/dashboard/api/signOut.js @@ -56,7 +56,7 @@ const normalisedURLPath_1 = __importDefault(require("../../../normalisedURLPath" function signOut(_, options) { var _a; return __awaiter(this, void 0, void 0, function* () { - if (options.config.apiKey) { + if (options.config.authMode === "api-key") { utils_1.send200Response(options.res, { status: "OK" }); } else { const sessionIdFormAuthHeader = diff --git a/lib/build/version.d.ts b/lib/build/version.d.ts index ee9523fe7..27f4a8892 100644 --- a/lib/build/version.d.ts +++ b/lib/build/version.d.ts @@ -1,4 +1,4 @@ // @ts-nocheck -export declare const version = "13.1.0"; +export declare const version = "13.1.1"; export declare const cdiSupported: string[]; export declare const dashboardVersion = "0.4"; diff --git a/lib/build/version.js b/lib/build/version.js index dd22962dd..51057fe78 100644 --- a/lib/build/version.js +++ b/lib/build/version.js @@ -15,7 +15,7 @@ exports.dashboardVersion = exports.cdiSupported = exports.version = void 0; * License for the specific language governing permissions and limitations * under the License. */ -exports.version = "13.1.0"; +exports.version = "13.1.1"; exports.cdiSupported = ["2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17", "2.18"]; // Note: The actual script import for dashboard uses v{DASHBOARD_VERSION} exports.dashboardVersion = "0.4"; diff --git a/lib/ts/recipe/dashboard/api/signOut.ts b/lib/ts/recipe/dashboard/api/signOut.ts index 69d5f1205..5fe3a0b64 100644 --- a/lib/ts/recipe/dashboard/api/signOut.ts +++ b/lib/ts/recipe/dashboard/api/signOut.ts @@ -19,7 +19,7 @@ import { Querier } from "../../../querier"; import NormalisedURLPath from "../../../normalisedURLPath"; export default async function signOut(_: APIInterface, options: APIOptions): Promise { - if (options.config.apiKey) { + if (options.config.authMode === "api-key") { send200Response(options.res, { status: "OK" }); } else { const sessionIdFormAuthHeader = options.req.getHeaderValue("authorization")?.split(" ")[1]; diff --git a/lib/ts/version.ts b/lib/ts/version.ts index 162af3e91..3f9ff8fff 100644 --- a/lib/ts/version.ts +++ b/lib/ts/version.ts @@ -12,7 +12,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -export const version = "13.1.0"; +export const version = "13.1.1"; export const cdiSupported = ["2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17", "2.18"]; diff --git a/package-lock.json b/package-lock.json index d064b86cc..c9bc03de0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "supertokens-node", - "version": "13.1.0", + "version": "13.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "supertokens-node", - "version": "13.1.0", + "version": "13.1.1", "license": "Apache-2.0", "dependencies": { "axios": "0.21.4", diff --git a/package.json b/package.json index 131af4840..5840a3829 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "supertokens-node", - "version": "13.1.0", + "version": "13.1.1", "description": "NodeJS driver for SuperTokens core", "main": "index.js", "scripts": {