@ciscode/authentication-kit 1.1.3 → 1.1.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.
@@ -201,8 +201,10 @@ let AuthController = class AuthController {
201
201
  }
202
202
  microsoftCallback(req, res, next) {
203
203
  passport_config_1.default.authenticate('azure_ad_oauth2', { session: false }, async (err, user) => {
204
- if (err)
205
- return next(err);
204
+ if (err) {
205
+ console.error('Microsoft OAuth error:', err);
206
+ return res.status(500).json({ message: 'Microsoft auth failed', error: (err === null || err === void 0 ? void 0 : err.message) || err });
207
+ }
206
208
  if (!user)
207
209
  return res.status(400).json({ message: 'Microsoft authentication failed.' });
208
210
  return this.respondWebOrMobile(req, res, user);
@@ -407,8 +409,10 @@ let AuthController = class AuthController {
407
409
  }
408
410
  microsoftClientCallback(req, res, next) {
409
411
  passport_config_1.default.authenticate('azure_ad_oauth2_client', { session: false }, async (err, client) => {
410
- if (err)
411
- return next(err);
412
+ if (err) {
413
+ console.error('Microsoft Client OAuth error:', err);
414
+ return res.status(500).json({ message: 'Microsoft auth failed', error: (err === null || err === void 0 ? void 0 : err.message) || err });
415
+ }
412
416
  if (!client)
413
417
  return res.status(400).json({ message: 'Microsoft authentication failed.' });
414
418
  return this.respondWebOrMobile(req, res, client);
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/CISCODE-MA/AuthKit.git"
9
9
  },
10
- "version": "1.1.3",
10
+ "version": "1.1.4",
11
11
  "description": "A login library with local login, Microsoft Entra ID authentication, password reset, and roles/permissions.",
12
12
  "main": "dist/index.js",
13
13
  "types": "dist/index.d.ts",