mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
Merge pull request #3541 from strapi/fix/koa-grant-new-release-breaking
Fix grant-koa breaking with strapi on grant-koa v4.6.0
This commit is contained in:
commit
457e8a6306
@ -9,7 +9,7 @@
|
|||||||
/* eslint-disable no-useless-escape */
|
/* eslint-disable no-useless-escape */
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const compose = require('koa-compose');
|
const grant = require('grant-koa');
|
||||||
|
|
||||||
const emailRegExp = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
const emailRegExp = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||||
|
|
||||||
@ -263,10 +263,7 @@ module.exports = {
|
|||||||
return ctx.badRequest(null, 'This provider is disabled.');
|
return ctx.badRequest(null, 'This provider is disabled.');
|
||||||
}
|
}
|
||||||
|
|
||||||
const Grant = require('grant-koa');
|
return grant(grantConfig)(ctx, next);
|
||||||
const grant = new Grant(grantConfig);
|
|
||||||
|
|
||||||
return compose(grant.middleware)(ctx, next);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
forgotPassword: async ctx => {
|
forgotPassword: async ctx => {
|
||||||
|
|||||||
@ -14,11 +14,10 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bcryptjs": "^2.4.3",
|
"bcryptjs": "^2.4.3",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"grant-koa": "^4.2.0",
|
"grant-koa": "^4.6.0",
|
||||||
"immutable": "^3.8.2",
|
"immutable": "^3.8.2",
|
||||||
"invariant": "^2.2.1",
|
"invariant": "^2.2.1",
|
||||||
"jsonwebtoken": "^8.1.0",
|
"jsonwebtoken": "^8.1.0",
|
||||||
"koa-compose": "^4.0.0",
|
|
||||||
"koa2-ratelimit": "^0.6.1",
|
"koa2-ratelimit": "^0.6.1",
|
||||||
"lodash": "^4.17.11",
|
"lodash": "^4.17.11",
|
||||||
"purest": "^2.0.1",
|
"purest": "^2.0.1",
|
||||||
|
|||||||
18
yarn.lock
18
yarn.lock
@ -7934,17 +7934,17 @@ graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.
|
|||||||
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
|
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
|
||||||
integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=
|
integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=
|
||||||
|
|
||||||
grant-koa@^4.2.0:
|
grant-koa@^4.6.0:
|
||||||
version "4.5.2"
|
version "4.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/grant-koa/-/grant-koa-4.5.2.tgz#a02e49c5ff3e593253023f3b3115441b1d0f54c7"
|
resolved "https://registry.yarnpkg.com/grant-koa/-/grant-koa-4.6.0.tgz#00ae29c66d1ad3b3b284bb9742cdbf934ba25fbf"
|
||||||
integrity sha512-lbBE2LjQhf14nRJAlVv5P5ld1V6wQhRn107Db1R0oQ/AtLtJA5cNe0YqYJS2ofl9pDJj+x1apShYVRWK6i4k/w==
|
integrity sha512-zzSU+94m5kPN4Yb5gmRoJk34j50OBFCIczaUaB2n+o+NV84hTLXCRESZhp5BtvBDRY4ZTbsIKsgwCzsBHozQog==
|
||||||
dependencies:
|
dependencies:
|
||||||
grant "4.5.2"
|
grant "4.6.0"
|
||||||
|
|
||||||
grant@4.5.2:
|
grant@4.6.0:
|
||||||
version "4.5.2"
|
version "4.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/grant/-/grant-4.5.2.tgz#5401f119e6f119772386e5fb2e0eccf5d0d2c8b7"
|
resolved "https://registry.yarnpkg.com/grant/-/grant-4.6.0.tgz#2704bdeb27f6f3cae03b2fbf6eecf1415bc77bc5"
|
||||||
integrity sha512-96hyS0ouJ5CaO30YWLb9zatc2r23aLKvaM+81qnZWCpmL3l4/KTdaRoNG4X/e93vlmryyJr5jus/jrqctT6iFw==
|
integrity sha512-jAhKZssj5EMtC2XQSfUq/+wU0mbYYsUFWHb9cdV4XPdS6IINmEMIwI68Wj9MpLJTrUQJ48CzqfGpo4Mve11RvQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
qs "^6.7.0"
|
qs "^6.7.0"
|
||||||
request-compose "^1.2.0"
|
request-compose "^1.2.0"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user