From 39c9793a78e5ed40b797025d4e86b6593cec7c27 Mon Sep 17 00:00:00 2001 From: RaviAnand Mohabir Date: Mon, 24 May 2021 16:21:08 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Dynamically=20build=20`RegExp`?= =?UTF-8?q?=20with=20`basePath`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/auth.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/auth.ts b/src/auth.ts index caa192c..5cfc383 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -164,7 +164,8 @@ export class Auth { }; } - const match = path.match(/\/api\/auth\/(?signin|callback)\/(?\w+)/); + const regex = new RegExp(join([this.basePath, `(?signin|callback)/(?\\w+)`])); + const match = path.match(regex); if (match && match.groups) { const provider = this.config?.providers?.find(