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 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'client/src/app/core/auth') 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( -- cgit v1.2.3