diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-22 11:29:06 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-22 11:29:06 +0200 |
commit | 4eca42ffb4a1f17779d931b84da96ef8d9b3997e (patch) | |
tree | 6d6d46627aeb008f50c7287023281bdae4e22970 /client/src/app | |
parent | 0ea9f463a9dc642ec44af4887b97e9dd63b323ef (diff) | |
download | PeerTube-4eca42ffb4a1f17779d931b84da96ef8d9b3997e.tar.gz PeerTube-4eca42ffb4a1f17779d931b84da96ef8d9b3997e.tar.zst PeerTube-4eca42ffb4a1f17779d931b84da96ef8d9b3997e.zip |
Add getAuthHeader client helper
Diffstat (limited to 'client/src/app')
-rw-r--r-- | client/src/app/core/plugins/plugin.service.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts index ee80d4d39..6a1a46e73 100644 --- a/client/src/app/core/plugins/plugin.service.ts +++ b/client/src/app/core/plugins/plugin.service.ts | |||
@@ -271,6 +271,13 @@ export class PluginService implements ClientHook { | |||
271 | return this.authService.isLoggedIn() | 271 | return this.authService.isLoggedIn() |
272 | }, | 272 | }, |
273 | 273 | ||
274 | getAuthHeader: () => { | ||
275 | if (!this.authService.isLoggedIn()) return undefined | ||
276 | |||
277 | const value = this.authService.getRequestHeaderValue() | ||
278 | return { 'Authorization': value } | ||
279 | }, | ||
280 | |||
274 | notifier: { | 281 | notifier: { |
275 | info: (text: string, title?: string, timeout?: number) => this.notifier.info(text, title, timeout), | 282 | info: (text: string, title?: string, timeout?: number) => this.notifier.info(text, title, timeout), |
276 | error: (text: string, title?: string, timeout?: number) => this.notifier.error(text, title, timeout), | 283 | error: (text: string, title?: string, timeout?: number) => this.notifier.error(text, title, timeout), |