From 1791a242da3a77cb69c003bda9ad69f338e82a3a Mon Sep 17 00:00:00 2001 From: Jonne Kleijer Date: Tue, 5 Nov 2024 23:05:15 +0100 Subject: [PATCH 1/2] fix msha: regex for custom authentication providers various documented providers currently do not work with the local authorization emulator (e.g. auth0, aadb2c), because numbers are not captured in the regex Fixes #844 --- src/msha/auth/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msha/auth/index.ts b/src/msha/auth/index.ts index d313545c..91150c51 100644 --- a/src/msha/auth/index.ts +++ b/src/msha/auth/index.ts @@ -36,7 +36,7 @@ function getAuthPaths(isCustomAuth: boolean): Path[] { } else { paths.push({ method: "GET", - route: /^\/\.auth\/login\/(?github|twitter|google|facebook|[a-z]+)(\?.*)?$/i, + route: /^\/\.auth\/login\/(?github|twitter|google|facebook|[a-z0-9]+)(\?.*)?$/i, function: "auth-login-provider", }); } From 3c94858864df7d5388c5da97ab3b3538eb6098de Mon Sep 17 00:00:00 2001 From: Jonne Kleijer Date: Tue, 5 Nov 2024 23:05:15 +0100 Subject: [PATCH 2/2] fix msha: regex for custom authentication providers various documented providers currently do not work with the local authorization emulator (e.g. auth0, aadb2c), because numbers are not captured in the regex Fixes #844 --- src/msha/auth/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msha/auth/index.ts b/src/msha/auth/index.ts index d313545c..27317821 100644 --- a/src/msha/auth/index.ts +++ b/src/msha/auth/index.ts @@ -36,7 +36,7 @@ function getAuthPaths(isCustomAuth: boolean): Path[] { } else { paths.push({ method: "GET", - route: /^\/\.auth\/login\/(?github|twitter|google|facebook|[a-z]+)(\?.*)?$/i, + route: /^\/\.auth\/login\/(?github|twitter|google|facebook|[a-z0-9]+)(\?.*)?$/i, function: "auth-login-provider", }); } @@ -54,7 +54,7 @@ function getAuthPaths(isCustomAuth: boolean): Path[] { }, { method: "GET", - route: /^\/\.auth\/purge\/(?aad|github|twitter|google|facebook|[a-z]+)(\?.*)?$/i, + route: /^\/\.auth\/purge\/(?aad|github|twitter|google|facebook|[a-z0-9]+)(\?.*)?$/i, // locally, all purge requests are processed as logout requests function: "auth-logout", },