diff --git a/src/utils/AuthManager.ts b/src/utils/AuthManager.ts index 50c47b8..c2f8544 100644 --- a/src/utils/AuthManager.ts +++ b/src/utils/AuthManager.ts @@ -212,30 +212,18 @@ export class AuthManager { } public static createAuthenticatedJtagHubConnection() { - const token = this.getToken(); - if (isNull(token)) { - router.push("/login"); - throw Error("Token Null!"); - } - return new HubConnectionBuilder() .withUrl("http://127.0.0.1:5000/hubs/JtagHub", { - accessTokenFactory: () => token, + accessTokenFactory: () => this.getToken() ?? "", }) .withAutomaticReconnect() .build(); } public static createAuthenticatedProgressHubConnection() { - const token = this.getToken(); - if (isNull(token)) { - router.push("/login"); - throw Error("Token Null!"); - } - return new HubConnectionBuilder() .withUrl("http://127.0.0.1:5000/hubs/ProgressHub", { - accessTokenFactory: () => token, + accessTokenFactory: () => this.getToken() ?? "", }) .withAutomaticReconnect() .build();