diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-17 11:28:11 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-17 11:28:11 +0200 |
commit | 154898b0b7bc1af41fc5a94974e338a3590c90f3 (patch) | |
tree | 5fb90f66da7587aed53c99ac1884c7acd0c1f7ca /client/src/app/core/auth | |
parent | df98563e2104b82b119c00a3cd83cd0dc1242d25 (diff) | |
download | PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.tar.gz PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.tar.zst PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.zip |
Share models between server and client
Diffstat (limited to 'client/src/app/core/auth')
-rw-r--r-- | client/src/app/core/auth/auth.service.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index 32f7a5503..fcc6b9bb6 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts | |||
@@ -11,6 +11,7 @@ import { NotificationsService } from 'angular2-notifications' | |||
11 | 11 | ||
12 | import { AuthStatus } from './auth-status.model' | 12 | import { AuthStatus } from './auth-status.model' |
13 | import { AuthUser } from './auth-user.model' | 13 | import { AuthUser } from './auth-user.model' |
14 | import { ClientLocal } from '../../../../../shared' | ||
14 | // Do not use the barrel (dependency loop) | 15 | // Do not use the barrel (dependency loop) |
15 | import { RestExtractor } from '../../shared/rest' | 16 | import { RestExtractor } from '../../shared/rest' |
16 | 17 | ||
@@ -40,9 +41,9 @@ export class AuthService { | |||
40 | // FIXME: save in local storage? | 41 | // FIXME: save in local storage? |
41 | this.http.get(AuthService.BASE_CLIENT_URL) | 42 | this.http.get(AuthService.BASE_CLIENT_URL) |
42 | .map(this.restExtractor.extractDataGet) | 43 | .map(this.restExtractor.extractDataGet) |
43 | .catch((res) => this.restExtractor.handleError(res)) | 44 | .catch(res => this.restExtractor.handleError(res)) |
44 | .subscribe( | 45 | .subscribe( |
45 | result => { | 46 | (result: ClientLocal) => { |
46 | this.clientId = result.client_id | 47 | this.clientId = result.client_id |
47 | this.clientSecret = result.client_secret | 48 | this.clientSecret = result.client_secret |
48 | console.log('Client credentials loaded.') | 49 | console.log('Client credentials loaded.') |