Merge pull request #4994 from fregu/fix/readCallbackProvider

remove querystring from ctx.path when reading provider
This commit is contained in:
Alexandre BODIN 2020-01-15 14:10:54 +01:00 committed by GitHub
commit a5881da622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -254,10 +254,11 @@ module.exports = {
const [protocol, host] = strapi.config.url.split('://');
_.defaultsDeep(grantConfig, { server: { protocol, host } });
const [requestPath] = ctx.request.url.split('?');
const provider =
process.platform === 'win32'
? ctx.request.url.split('\\')[2]
: ctx.request.url.split('/')[2];
? requestPath.split('\\')[2]
: requestPath.split('/')[2];
const config = grantConfig[provider];
if (!_.get(config, 'enabled')) {