🐛 Dynamically build RegExp with basePath

This commit is contained in:
RaviAnand Mohabir 2021-05-24 16:21:08 +02:00
parent 98f73f36ea
commit 39c9793a78

View File

@ -164,7 +164,8 @@ export class Auth {
};
}
const match = path.match(/\/api\/auth\/(?<method>signin|callback)\/(?<provider>\w+)/);
const regex = new RegExp(join([this.basePath, `(?<method>signin|callback)/(?<provider>\\w+)`]));
const match = path.match(regex);
if (match && match.groups) {
const provider = this.config?.providers?.find(