diff options
Diffstat (limited to 'client/src/app/core/auth')
-rw-r--r-- | client/src/app/core/auth/auth-user.model.ts | 18 | ||||
-rw-r--r-- | client/src/app/core/auth/auth.service.ts | 13 |
2 files changed, 16 insertions, 15 deletions
diff --git a/client/src/app/core/auth/auth-user.model.ts b/client/src/app/core/auth/auth-user.model.ts index 4ad904beb..4e7801550 100644 --- a/client/src/app/core/auth/auth-user.model.ts +++ b/client/src/app/core/auth/auth-user.model.ts | |||
@@ -1,10 +1,14 @@ | |||
1 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' | 1 | import { User } from '@app/core/users/user.model' |
2 | import { UserRight } from '../../../../../shared/models/users/user-right.enum' | 2 | import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage' |
3 | import { MyUser as ServerMyUserModel, User as ServerUserModel, MyUserSpecialPlaylist } from '../../../../../shared/models/users/user.model' | 3 | import { |
4 | // Do not use the barrel (dependency loop) | 4 | hasUserRight, |
5 | import { hasUserRight, UserRole } from '../../../../../shared/models/users/user-role' | 5 | MyUser as ServerMyUserModel, |
6 | import { User } from '../../shared/users/user.model' | 6 | MyUserSpecialPlaylist, |
7 | import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' | 7 | NSFWPolicyType, |
8 | User as ServerUserModel, | ||
9 | UserRight, | ||
10 | UserRole | ||
11 | } from '@shared/models' | ||
8 | 12 | ||
9 | export type TokenOptions = { | 13 | export type TokenOptions = { |
10 | accessToken: string | 14 | accessToken: string |
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index de8c509d1..94262b9aa 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts | |||
@@ -1,20 +1,17 @@ | |||
1 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' | ||
1 | import { Observable, ReplaySubject, Subject, throwError as observableThrowError } from 'rxjs' | 2 | import { Observable, ReplaySubject, Subject, throwError as observableThrowError } from 'rxjs' |
2 | import { catchError, map, mergeMap, share, tap } from 'rxjs/operators' | 3 | import { catchError, map, mergeMap, share, tap } from 'rxjs/operators' |
3 | import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http' |
4 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
5 | import { Router } from '@angular/router' | 6 | import { Router } from '@angular/router' |
6 | import { Notifier } from '@app/core/notification/notifier.service' | 7 | import { Notifier } from '@app/core/notification/notifier.service' |
7 | import { OAuthClientLocal, MyUser as UserServerModel, UserRefreshToken } from '../../../../../shared' | 8 | import { objectToUrlEncoded, peertubeLocalStorage } from '@app/helpers' |
8 | import { User } from '../../../../../shared/models/users' | 9 | import { I18n } from '@ngx-translate/i18n-polyfill' |
9 | import { UserLogin } from '../../../../../shared/models/users/user-login.model' | 10 | import { MyUser as UserServerModel, OAuthClientLocal, User, UserLogin, UserRefreshToken } from '@shared/models' |
10 | import { environment } from '../../../environments/environment' | 11 | import { environment } from '../../../environments/environment' |
11 | import { RestExtractor } from '../../shared/rest/rest-extractor.service' | 12 | import { RestExtractor } from '../rest/rest-extractor.service' |
12 | import { AuthStatus } from './auth-status.model' | 13 | import { AuthStatus } from './auth-status.model' |
13 | import { AuthUser } from './auth-user.model' | 14 | import { AuthUser } from './auth-user.model' |
14 | import { objectToUrlEncoded } from '@app/shared/misc/utils' | ||
15 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' | ||
16 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
17 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' | ||
18 | 15 | ||
19 | interface UserLoginWithUsername extends UserLogin { | 16 | interface UserLoginWithUsername extends UserLogin { |
20 | access_token: string | 17 | access_token: string |