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:
@@ -88,10 +88,8 @@ export class AuthenticationService {
|
|||||||
this.rememberMe = loginContext.remember;
|
this.rememberMe = loginContext.remember;
|
||||||
this.storage = this.rememberMe ? localStorage : sessionStorage;
|
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) {
|
if (environment.oauth.enabled) {
|
||||||
|
let httpParams = new HttpParams();
|
||||||
httpParams = httpParams.set('client_id', 'community-app');
|
httpParams = httpParams.set('client_id', 'community-app');
|
||||||
httpParams = httpParams.set('grant_type', 'password');
|
httpParams = httpParams.set('grant_type', 'password');
|
||||||
httpParams = httpParams.set('client_secret', '123');
|
httpParams = httpParams.set('client_secret', '123');
|
||||||
@@ -103,7 +101,7 @@ export class AuthenticationService {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return this.http.post('/authentication', {}, { params: httpParams })
|
return this.http.post('/authentication', { username: loginContext.username, password: loginContext.password })
|
||||||
.pipe(
|
.pipe(
|
||||||
map((credentials: Credentials) => {
|
map((credentials: Credentials) => {
|
||||||
this.onLoginSuccess(credentials);
|
this.onLoginSuccess(credentials);
|
||||||
|
|||||||
Reference in New Issue
Block a user