aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-26 11:49:44 +0200
committerChocobozzz <me@florianbigard.com>2018-03-26 11:49:44 +0200
commitbf9ae5ce57c9e2117548ab5794c0c2a5096ba4ad (patch)
tree9e1e80f2681552df8813469cce231e1a9e370951 /client
parent53eb90c0ab584ee48774e15ee7c0e764cfe4559d (diff)
downloadPeerTube-bf9ae5ce57c9e2117548ab5794c0c2a5096ba4ad.tar.gz
PeerTube-bf9ae5ce57c9e2117548ab5794c0c2a5096ba4ad.tar.zst
PeerTube-bf9ae5ce57c9e2117548ab5794c0c2a5096ba4ad.zip
Fix log in with special password character (+)
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))