@strapi/plugin-users-permissions 4.3.3 → 4.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/server/controllers/auth.js +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/plugin-users-permissions",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.4",
|
|
4
4
|
"description": "Protect your API with a full-authentication process based on JWT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@strapi/helper-plugin": "4.3.
|
|
31
|
-
"@strapi/utils": "4.3.
|
|
30
|
+
"@strapi/helper-plugin": "4.3.4",
|
|
31
|
+
"@strapi/utils": "4.3.4",
|
|
32
32
|
"bcryptjs": "2.4.3",
|
|
33
33
|
"grant-koa": "5.4.8",
|
|
34
34
|
"jsonwebtoken": "^8.1.0",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"required": true,
|
|
60
60
|
"kind": "plugin"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "28a2a00db8234ffcf644661c4c8092aa82f8c119"
|
|
63
63
|
}
|
|
@@ -91,6 +91,18 @@ module.exports = {
|
|
|
91
91
|
user: await sanitizeUser(user, ctx),
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
+
|
|
95
|
+
// Connect the user with the third-party provider.
|
|
96
|
+
try {
|
|
97
|
+
const user = await getService('providers').connect(provider, ctx.query);
|
|
98
|
+
|
|
99
|
+
return ctx.send({
|
|
100
|
+
jwt: getService('jwt').issue({ id: user.id }),
|
|
101
|
+
user: await sanitizeUser(user, ctx),
|
|
102
|
+
});
|
|
103
|
+
} catch (error) {
|
|
104
|
+
throw new ApplicationError(error.message);
|
|
105
|
+
}
|
|
94
106
|
},
|
|
95
107
|
|
|
96
108
|
async changePassword(ctx) {
|