@cemiar/auth-sdk 1.0.4 → 1.0.5

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.
@@ -70,16 +70,21 @@ export class CemiarAuthClient {
70
70
  }
71
71
  handleRedirectMicrosoftCallback(routeQueryData) {
72
72
  const token = routeQueryData["token"];
73
- if (token) {
74
- this.setAccessToken(token);
75
- this.persistLoginMethod("microsoft");
76
- const claim = tokenToClaimBrowser(token);
77
- return {
78
- email: claim.sub,
79
- displayName: claim.displayName
80
- };
73
+ if (!token) {
74
+ console.error("No token found in Microsoft redirect callback.");
75
+ const error = routeQueryData["error"];
76
+ if (error) {
77
+ console.error("Error from Microsoft login:", error);
78
+ }
79
+ return null;
81
80
  }
82
- return null;
81
+ this.setAccessToken(token);
82
+ this.persistLoginMethod("microsoft");
83
+ const claim = tokenToClaimBrowser(token);
84
+ return {
85
+ email: claim.sub,
86
+ displayName: claim.displayName
87
+ };
83
88
  }
84
89
  getMicrosoftLoginUrl(extraParams = {}) {
85
90
  this.persistLoginMethod("microsoft");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cemiar/auth-sdk",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Cemiar Auth integration helpers for web apps and APIs.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",