From 314d0fa977e00fdaa39a93b1c433797dccd50e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vorburger=20=E2=9B=91=EF=B8=8F?= Date: Sun, 24 May 2020 15:35:53 +0200 Subject: [PATCH] fix: login to current versions of Fineract API (#742) Refer https://issues.apache.org/jira/browse/FINERACT-726 Fixes: #741 --- src/app/core/authentication/authentication.service.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/core/authentication/authentication.service.ts b/src/app/core/authentication/authentication.service.ts index 41b588d24..bb6385608 100644 --- a/src/app/core/authentication/authentication.service.ts +++ b/src/app/core/authentication/authentication.service.ts @@ -88,10 +88,8 @@ export class AuthenticationService { this.rememberMe = loginContext.remember; this.storage = this.rememberMe ? localStorage : sessionStorage; - let httpParams = new HttpParams(); - httpParams = httpParams.set('username', loginContext.username); - httpParams = httpParams.set('password', loginContext.password); if (environment.oauth.enabled) { + let httpParams = new HttpParams(); httpParams = httpParams.set('client_id', 'community-app'); httpParams = httpParams.set('grant_type', 'password'); httpParams = httpParams.set('client_secret', '123'); @@ -103,7 +101,7 @@ export class AuthenticationService { }) ); } else { - return this.http.post('/authentication', {}, { params: httpParams }) + return this.http.post('/authentication', { username: loginContext.username, password: loginContext.password }) .pipe( map((credentials: Credentials) => { this.onLoginSuccess(credentials);