From db1130f96a6c9cda99df43d5774134aefffeee3e Mon Sep 17 00:00:00 2001 From: Alexander Lee Date: Mon, 3 Apr 2023 10:18:42 +0800 Subject: [PATCH 1/2] Fix: change response for github users accessing collaborator endpoints --- src/middleware/authorization.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/middleware/authorization.ts b/src/middleware/authorization.ts index 1bfbdf507..9d46d05fd 100644 --- a/src/middleware/authorization.ts +++ b/src/middleware/authorization.ts @@ -20,7 +20,8 @@ export class AuthorizationMiddleware { autoBind(this) } - // Check whether a user is using email login or github login + // Allows access only to users using email login + // If using Github login, immediately returns 200 response instead verifyIsEmailUser: RequestHandler< never, unknown, @@ -29,7 +30,8 @@ export class AuthorizationMiddleware { { userWithSiteSessionData: UserWithSiteSessionData } > = async (req, res, next) => { const { userWithSiteSessionData } = res.locals - if (!userWithSiteSessionData.isEmailUser()) return next("router") + if (!userWithSiteSessionData.isEmailUser()) + return res.status(200).send("OK") return next() } From cf7135a665cc517da08df820ec7c4db1ed8e24af Mon Sep 17 00:00:00 2001 From: Alexander Lee Date: Mon, 3 Apr 2023 10:26:13 +0800 Subject: [PATCH 2/2] 0.18.2 --- CHANGELOG.md | 9 ++++++++- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5febabc55..95397f715 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,17 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -#### [v0.18.1](https://github.com/isomerpages/isomercms-backend/compare/v0.18.0...v0.18.1) +#### [v0.18.2](https://github.com/isomerpages/isomercms-backend/compare/v0.18.1...v0.18.2) - fix(review): return 200 for unmigrated sites [`bd69c29`](https://github.com/isomerpages/isomercms-backend/commit/bd69c29023554c5dcf8cb361227ba4ebf0d1ac08) - fix(sanitize): use same setup for dompurify as FE [`c25f448`](https://github.com/isomerpages/isomercms-backend/commit/c25f448813e1addce67d0209375ec35ef9cb6c7b) +- Fix: change response for github users accessing collaborator endpoints [`db1130f`](https://github.com/isomerpages/isomercms-backend/commit/db1130f96a6c9cda99df43d5774134aefffeee3e) + +#### [v0.18.1](https://github.com/isomerpages/isomercms-backend/compare/v0.18.0...v0.18.1) + +> 31 March 2023 + +- fix(review): return 200 for unmigrated sites [`073cab8`](https://github.com/isomerpages/isomercms-backend/commit/073cab8c6704178ee5061b8582b4f999720dfc95) #### [v0.18.0](https://github.com/isomerpages/isomercms-backend/compare/v0.17.0...v0.18.0) diff --git a/package-lock.json b/package-lock.json index 20c5b36de..f1709dfca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "isomercms", - "version": "0.18.1", + "version": "0.18.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 25eee45c9..1a84ccc73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "isomercms", - "version": "0.18.1", + "version": "0.18.2", "private": true, "scripts": { "build": "tsc -p tsconfig.build.json",