diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-15 15:30:14 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-18 11:37:18 +0200 |
commit | 42b40636991b97fe818007fab19091764fc5db73 (patch) | |
tree | db431787c06ce898d22e91ff771f795219274fc6 /client/src/app/core/auth/auth.service.ts | |
parent | 654d4ede7fa4d0faa71e49bcfab6b65a686397b2 (diff) | |
download | PeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.gz PeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.zst PeerTube-42b40636991b97fe818007fab19091764fc5db73.zip |
Add ability for client to create server logs
Diffstat (limited to 'client/src/app/core/auth/auth.service.ts')
-rw-r--r-- | client/src/app/core/auth/auth.service.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index 2ac88c185..ece6bc5d1 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts | |||
@@ -5,7 +5,7 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http' | |||
5 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
6 | import { Router } from '@angular/router' | 6 | import { Router } from '@angular/router' |
7 | import { Notifier } from '@app/core/notification/notifier.service' | 7 | import { Notifier } from '@app/core/notification/notifier.service' |
8 | import { objectToUrlEncoded, peertubeLocalStorage, UserTokens } from '@root-helpers/index' | 8 | import { logger, objectToUrlEncoded, peertubeLocalStorage, UserTokens } from '@root-helpers/index' |
9 | import { HttpStatusCode, MyUser as UserServerModel, OAuthClientLocal, User, UserLogin, UserRefreshToken } from '@shared/models' | 9 | import { HttpStatusCode, MyUser as UserServerModel, OAuthClientLocal, User, UserLogin, UserRefreshToken } from '@shared/models' |
10 | import { environment } from '../../../environments/environment' | 10 | import { environment } from '../../../environments/environment' |
11 | import { RestExtractor } from '../rest/rest-extractor.service' | 11 | import { RestExtractor } from '../rest/rest-extractor.service' |
@@ -90,7 +90,7 @@ export class AuthService { | |||
90 | peertubeLocalStorage.setItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_ID, this.clientId) | 90 | peertubeLocalStorage.setItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_ID, this.clientId) |
91 | peertubeLocalStorage.setItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_SECRET, this.clientSecret) | 91 | peertubeLocalStorage.setItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_SECRET, this.clientSecret) |
92 | 92 | ||
93 | console.log('Client credentials loaded.') | 93 | logger.info('Client credentials loaded.') |
94 | }, | 94 | }, |
95 | 95 | ||
96 | error: err => { | 96 | error: err => { |
@@ -177,7 +177,7 @@ Ensure you have correctly configured PeerTube (config/ directory), in particular | |||
177 | } | 177 | } |
178 | }, | 178 | }, |
179 | 179 | ||
180 | error: err => console.error(err) | 180 | error: err => logger.error(err) |
181 | }) | 181 | }) |
182 | 182 | ||
183 | this.user = null | 183 | this.user = null |
@@ -190,7 +190,7 @@ Ensure you have correctly configured PeerTube (config/ directory), in particular | |||
190 | refreshAccessToken () { | 190 | refreshAccessToken () { |
191 | if (this.refreshingTokenObservable) return this.refreshingTokenObservable | 191 | if (this.refreshingTokenObservable) return this.refreshingTokenObservable |
192 | 192 | ||
193 | console.log('Refreshing token...') | 193 | logger.info('Refreshing token...') |
194 | 194 | ||
195 | const refreshToken = this.getRefreshToken() | 195 | const refreshToken = this.getRefreshToken() |
196 | 196 | ||
@@ -212,8 +212,8 @@ Ensure you have correctly configured PeerTube (config/ directory), in particular | |||
212 | catchError(err => { | 212 | catchError(err => { |
213 | this.refreshingTokenObservable = null | 213 | this.refreshingTokenObservable = null |
214 | 214 | ||
215 | console.error(err) | 215 | logger.error(err) |
216 | console.log('Cannot refresh token -> logout...') | 216 | logger.info('Cannot refresh token -> logout...') |
217 | this.logout() | 217 | this.logout() |
218 | this.router.navigate([ '/login' ]) | 218 | this.router.navigate([ '/login' ]) |
219 | 219 | ||