fix: login to current versions of Fineract API (#742)

Refer https://issues.apache.org/jira/browse/FINERACT-726

Fixes: #741
This commit is contained in:
Michael Vorburger ⛑️
2020-05-24 19:05:53 +05:30
committed by GitHub
parent cf7c571c83
commit 314d0fa977
@@ -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);