diff options
author | crupest <crupest@outlook.com> | 2021-05-16 19:46:39 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-05-16 19:46:39 +0800 |
commit | 02bf6c7e92fbd18d8409f8c6b84717aaf4d5664b (patch) | |
tree | 469897c11c1ce13a51571b62b3aadf3342358aa9 /FrontEnd/src | |
parent | e3ee59e8101a786325c00e92a230e1de8069584e (diff) | |
download | timeline-02bf6c7e92fbd18d8409f8c6b84717aaf4d5664b.tar.gz timeline-02bf6c7e92fbd18d8409f8c6b84717aaf4d5664b.tar.bz2 timeline-02bf6c7e92fbd18d8409f8c6b84717aaf4d5664b.zip |
fix: Fix the way pass token to signalr.
Diffstat (limited to 'FrontEnd/src')
-rw-r--r-- | FrontEnd/src/app/services/timeline.ts | 8 |
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(); } |