@singularsystems/neo-core 1.4.0 → 1.4.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Neo core changelog
2
2
 
3
+ ## Version 1.4.2 (11 May 2026)
4
+
5
+ - Authentication service
6
+ - Changed `loadUserFromSession` to try perform a silent sign in when the app is opened from another window.
7
+ - Change your startup code accordingly:
8
+ ```diff
9
+ -if (config.isDevelopment) {
10
+ - await authService.loadUserFromSession();
11
+ -}
12
+ +await authService.loadUserFromSession();
13
+ ```
14
+
15
+ ## Version 1.4.1 (20 April 2026)
16
+
17
+ - Navigation helper
18
+ - Changed `openWindow` and `readOpenerState` to store state as string.
19
+
3
20
  ## Version 1.4.0 (16 April 2026)
4
21
 
5
22
  - Dates decorated with `TimeZoneFormat.None` will now correctly deserialise into `DateOnly` properties on the server.
@@ -14,15 +14,15 @@ export interface INavigationHelper {
14
14
  */
15
15
  openWindow(path: string, state?: {
16
16
  name: string;
17
- value: object;
17
+ value: any;
18
18
  }, options?: {
19
19
  target?: string;
20
20
  features?: string;
21
21
  }): Window | null;
22
22
  /**
23
- * Reads the state passed from the opener to the current window.
23
+ * Reads the state passed from the opener to the current window. If an object was passed to `openWindow`, you will need to parse the stored value using JSON.parse.
24
24
  * @param name The name of the state to read. This should match the name provided in the state parameter of `openWindow`.
25
25
  * @param reset Whether to remove the state after read. Defaults to true.
26
26
  */
27
- readOpenerState(name: string, reset?: boolean): object | undefined;
27
+ readOpenerState(name: string, reset?: boolean): string | undefined;
28
28
  }
@@ -3,6 +3,7 @@ import { ISignInResult } from './SignInResult';
3
3
  export default interface IAuthenticationService {
4
4
  /**
5
5
  * Load a user from session storage if there is a stored token.
6
+ * Will also try perform a silent sign in if opened from another window.
6
7
  */
7
8
  loadUserFromSession(): Promise<IUser | null>;
8
9
  /**
@@ -20,7 +20,6 @@ export default abstract class OidcAuthService<TUser extends OidcUser = OidcUser>
20
20
  */
21
21
  constructor(userManager: IUserManager, axios: AxiosInstance);
22
22
  isSigningOut: boolean;
23
- loadUserFromToken(): Promise<TUser | null>;
24
23
  loadUserFromSession(): Promise<TUser | null>;
25
24
  ensureSignedIn(redirectLocal?: string): boolean;
26
25
  /**
@@ -28,9 +28,6 @@ var OidcAuthService = /** @class */ (function () {
28
28
  this.userManager.events.addAccessTokenExpiring(this.signinSilent.bind(this));
29
29
  }
30
30
  }
31
- OidcAuthService.prototype.loadUserFromToken = function () {
32
- return this.loadUserFromSession();
33
- };
34
31
  OidcAuthService.prototype.loadUserFromSession = function () {
35
32
  return __awaiter(this, void 0, void 0, function () {
36
33
  var user;
@@ -45,8 +42,14 @@ var OidcAuthService = /** @class */ (function () {
45
42
  return [4 /*yield*/, this.completeAfterUserLoaded()];
46
43
  case 2:
47
44
  _a.sent();
48
- _a.label = 3;
49
- case 3: return [2 /*return*/, this.user];
45
+ return [2 /*return*/, this.user];
46
+ case 3:
47
+ if (!!!window.opener) return [3 /*break*/, 5];
48
+ return [4 /*yield*/, this.userManager.signinSilent()];
49
+ case 4:
50
+ _a.sent();
51
+ return [2 /*return*/, this.user];
52
+ case 5: return [2 /*return*/, null];
50
53
  }
51
54
  });
52
55
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-core",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Core functionality for the Neo client library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",