Merge pull request #2198 from wknet123/release-1.1.0-fix

Encode sign-in params.
This commit is contained in:
kun wang 2017-05-03 19:05:30 +08:00 committed by GitHub
commit 11beddaaf9

View File

@ -68,12 +68,11 @@ export class SessionService {
//Submit signin form to backend (NOT restful service)
signIn(signInCredential: SignInCredential): Promise<any> {
//Build the form package
const body = new URLSearchParams();
body.set('principal', signInCredential.principal);
body.set('password', signInCredential.password);
let queryParam:string = 'principal=' + encodeURIComponent(signInCredential.principal) +
'&password=' + encodeURIComponent(signInCredential.password);
//Trigger Http
return this.http.post(signInUrl, body.toString(), { headers: this.formHeaders })
return this.http.post(signInUrl, queryParam, { headers: this.formHeaders })
.toPromise()
.then(() => null)
.catch(error => this.handleError(error));