adminizer 4.5.0-build.185 → 4.5.0-build.186
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/controllers/login.js
CHANGED
|
@@ -62,7 +62,11 @@ export default async function login(req, res) {
|
|
|
62
62
|
if (!req.adminizer.accessRightsHelper.hasPermission('access-to-adminpanel', user)) {
|
|
63
63
|
return inertiaAdminMessage(req, "The user is not allowed to enter, please contact the administrator", 'captchaSolution');
|
|
64
64
|
}
|
|
65
|
-
const token = signUser(
|
|
65
|
+
const token = signUser({
|
|
66
|
+
id: user.id,
|
|
67
|
+
login: user.login,
|
|
68
|
+
isAdministrator: user.isAdministrator,
|
|
69
|
+
}, req.adminizer.jwtSecret);
|
|
66
70
|
res.setHeader('Set-Cookie', serialize('adminizer_jwt', token, {
|
|
67
71
|
httpOnly: true,
|
|
68
72
|
sameSite: 'lax',
|
package/package.json
CHANGED
|
@@ -26,7 +26,6 @@ export default function bindReqFunctions(adminizer) {
|
|
|
26
26
|
const user = verifyUser(token, req.adminizer.jwtSecret);
|
|
27
27
|
if (user) {
|
|
28
28
|
req.user = await req.adminizer.modelHandler.model.get('userap')['_findOne']({ id: user.id });
|
|
29
|
-
// req.user = user;
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
if (req.session.userPretended) {
|