X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fcore%2Fauth%2Fauth.service.ts;h=f5ca2fcdc9d088c582702d286919082d2340ea3f;hb=bf9ae5ce57c9e2117548ab5794c0c2a5096ba4ad;hp=8700e8c742b541026655decfd430630472e01ec2;hpb=ce5496d6a31b9617aba67970f5dc135e73335234;p=github%2FChocobozzz%2FPeerTube.git 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 { login (username: string, password: string) { // Form url encoded - const body = new HttpParams().set('client_id', this.clientId) - .set('client_secret', this.clientSecret) - .set('response_type', 'code') - .set('grant_type', 'password') - .set('scope', 'upload') - .set('username', username) - .set('password', password) + const body = new URLSearchParams() + body.set('client_id', this.clientId) + body.set('client_secret', this.clientSecret) + body.set('response_type', 'code') + body.set('grant_type', 'password') + body.set('scope', 'upload') + body.set('username', username) + body.set('password', password) const headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded') - - return this.http.post(AuthService.BASE_TOKEN_URL, body, { headers }) + return this.http.post(AuthService.BASE_TOKEN_URL, body.toString(), { headers }) .map(res => Object.assign(res, { username })) .flatMap(res => this.mergeUserInformation(res)) .map(res => this.handleLogin(res))