-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Status: Resolvedarea-signalrIncludes: SignalR clients and serversIncludes: SignalR clients and servers
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I have very simple case: the hub is protected by the authorization policy, so some users can get 302 error when connecting to the hub. I need to catch this and show some some info of the client.
Expected Behavior
I can catch 302 errors.
Steps To Reproduce
connection: signalR.HubConnection;
this.connection = new signalR.HubConnectionBuilder()
.withAutomaticReconnect()
.withUrl(environment.apis.default.url + `/signalr-hubs/call-tracker`, {
accessTokenFactory: () => this.oAuthService.getAccessToken(),
})
.build();
this.connection
.start()
.then(() => {
this.callTrackerConnected = true;
this.callTrackerStatus = "OK";
console.log('Connection started');
})
.catch(err => {
this.callTrackerConnected = false;
this.callTrackerStatus = "ERROR";
this.callTrackerError = err;
console.error("Enable to connect to SignalR", err)
this.connection.stop();
});
I'm always getting 'Conection started' message in the console and this.connection.state
is always Connected
Exceptions (if any)
No response
.NET Version
No response
Anything else?
No response
Metadata
Metadata
Assignees
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Status: Resolvedarea-signalrIncludes: SignalR clients and serversIncludes: SignalR clients and servers