aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-05-16 19:46:39 +0800
committercrupest <crupest@outlook.com>2021-05-16 19:46:39 +0800
commit37fa764e9f23e058766bd444ce4e2e3806a1dcc2 (patch)
treefdfdfca96c2cc4d1190520ac3ebc0e1b6c7c5bda /FrontEnd/src
parent3960e6a7130d03b3c3e8f1e9dd9656727217bfaf (diff)
downloadtimeline-37fa764e9f23e058766bd444ce4e2e3806a1dcc2.tar.gz
timeline-37fa764e9f23e058766bd444ce4e2e3806a1dcc2.tar.bz2
timeline-37fa764e9f23e058766bd444ce4e2e3806a1dcc2.zip
fix: Fix the way pass token to signalr.
Diffstat (limited to 'FrontEnd/src')
-rw-r--r--FrontEnd/src/app/services/timeline.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/FrontEnd/src/app/services/timeline.ts b/FrontEnd/src/app/services/timeline.ts
index c49ba654..ff9662ad 100644
--- a/FrontEnd/src/app/services/timeline.ts
+++ b/FrontEnd/src/app/services/timeline.ts
@@ -22,13 +22,11 @@ export const timelineVisibilityTooltipTranslationMap: Record<
Private: "timeline.visibilityTooltip.private",
};
-function generateTimelineHubUrl(token: string | null): string {
- return `/api/hub/timeline${token == null ? "" : "?token=" + token}`;
-}
-
function createTimelineHubConnection(token: string | null): HubConnection {
return new HubConnectionBuilder()
- .withUrl(generateTimelineHubUrl(token))
+ .withUrl("/api/hub/timeline", {
+ accessTokenFactory: token == null ? undefined : () => token,
+ })
.withAutomaticReconnect()
.build();
}