diff options
author | Chocobozzz <me@florianbigard.com> | 2020-04-28 14:49:03 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-05-04 16:21:39 +0200 |
commit | 4a8d113b9b57d97ff13ad1608798eabca99643e4 (patch) | |
tree | 7c6e1ba86bff31680ba6c8ba4bd903b997592269 /client/src/app/core | |
parent | 98813e69bccc568eff771cfcaf907ccdd82ce3f1 (diff) | |
download | PeerTube-4a8d113b9b57d97ff13ad1608798eabca99643e4.tar.gz PeerTube-4a8d113b9b57d97ff13ad1608798eabca99643e4.tar.zst PeerTube-4a8d113b9b57d97ff13ad1608798eabca99643e4.zip |
Begin support for external auths
Diffstat (limited to 'client/src/app/core')
-rw-r--r-- | client/src/app/core/auth/auth.service.ts | 4 | ||||
-rw-r--r-- | client/src/app/core/server/server.service.ts | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index 9ae008e39..61d755ba0 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts | |||
@@ -145,7 +145,7 @@ export class AuthService { | |||
145 | return !!this.getAccessToken() | 145 | return !!this.getAccessToken() |
146 | } | 146 | } |
147 | 147 | ||
148 | login (username: string, password: string) { | 148 | login (username: string, password: string, token?: string) { |
149 | // Form url encoded | 149 | // Form url encoded |
150 | const body = { | 150 | const body = { |
151 | client_id: this.clientId, | 151 | client_id: this.clientId, |
@@ -157,6 +157,8 @@ export class AuthService { | |||
157 | password | 157 | password |
158 | } | 158 | } |
159 | 159 | ||
160 | if (token) Object.assign(body, { externalAuthToken: token }) | ||
161 | |||
160 | const headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded') | 162 | const headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded') |
161 | return this.http.post<UserLogin>(AuthService.BASE_TOKEN_URL, objectToUrlEncoded(body), { headers }) | 163 | return this.http.post<UserLogin>(AuthService.BASE_TOKEN_URL, objectToUrlEncoded(body), { headers }) |
162 | .pipe( | 164 | .pipe( |
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index da7832b32..eac8f85e4 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts | |||
@@ -54,7 +54,9 @@ export class ServerService { | |||
54 | } | 54 | } |
55 | }, | 55 | }, |
56 | plugin: { | 56 | plugin: { |
57 | registered: [] | 57 | registered: [], |
58 | registeredExternalAuths: [], | ||
59 | registeredIdAndPassAuths: [] | ||
58 | }, | 60 | }, |
59 | theme: { | 61 | theme: { |
60 | registered: [], | 62 | registered: [], |