From 4a8d113b9b57d97ff13ad1608798eabca99643e4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 28 Apr 2020 14:49:03 +0200 Subject: Begin support for external auths --- client/src/app/core/auth/auth.service.ts | 4 +++- client/src/app/core/server/server.service.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'client/src/app/core') 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 { return !!this.getAccessToken() } - login (username: string, password: string) { + login (username: string, password: string, token?: string) { // Form url encoded const body = { client_id: this.clientId, @@ -157,6 +157,8 @@ export class AuthService { password } + if (token) Object.assign(body, { externalAuthToken: token }) + const headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded') return this.http.post(AuthService.BASE_TOKEN_URL, objectToUrlEncoded(body), { headers }) .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 { } }, plugin: { - registered: [] + registered: [], + registeredExternalAuths: [], + registeredIdAndPassAuths: [] }, theme: { registered: [], -- cgit v1.2.3