aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/app/core/auth/auth.service.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts
index 8700e8c74..f5ca2fcdc 100644
--- a/client/src/app/core/auth/auth.service.ts
+++ b/client/src/app/core/auth/auth.service.ts
@@ -112,17 +112,17 @@ export class AuthService {
112 112
113 login (username: string, password: string) { 113 login (username: string, password: string) {
114 // Form url encoded 114 // Form url encoded
115 const body = new HttpParams().set('client_id', this.clientId) 115 const body = new URLSearchParams()
116 .set('client_secret', this.clientSecret) 116 body.set('client_id', this.clientId)
117 .set('response_type', 'code') 117 body.set('client_secret', this.clientSecret)
118 .set('grant_type', 'password') 118 body.set('response_type', 'code')
119 .set('scope', 'upload') 119 body.set('grant_type', 'password')
120 .set('username', username) 120 body.set('scope', 'upload')
121 .set('password', password) 121 body.set('username', username)
122 body.set('password', password)
122 123
123 const headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded') 124 const headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded')
124 125 return this.http.post<UserLogin>(AuthService.BASE_TOKEN_URL, body.toString(), { headers })
125 return this.http.post<UserLogin>(AuthService.BASE_TOKEN_URL, body, { headers })
126 .map(res => Object.assign(res, { username })) 126 .map(res => Object.assign(res, { username }))
127 .flatMap(res => this.mergeUserInformation(res)) 127 .flatMap(res => this.mergeUserInformation(res))
128 .map(res => this.handleLogin(res)) 128 .map(res => this.handleLogin(res))