mbkauthe 5.1.0 → 5.1.1

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.
@@ -482,7 +482,7 @@ const checkRolePermission = (requiredRoles, notAllowed) => {
482
482
  try {
483
483
  const authUser = req.auth?.user || req.session?.user;
484
484
 
485
- if (!authUser || !authUser.id) {
485
+ if (!authUser || !authUser.username) {
486
486
  logAuth(`User not authenticated`);
487
487
  if (isJsonRequest(req)) {
488
488
  return res.status(401).json(createErrorResponse(401, ErrorCodes.SESSION_NOT_FOUND));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mbkauthe",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "MBKTech's reusable authentication system for Node.js applications.",
5
5
  "main": "index.js",
6
6
  "type": "module",