Login form with Tenant dropdown menu

This commit is contained in:
Jose Alberto Hernandez
2022-11-29 22:18:54 -06:00
parent 8f1c17acdf
commit 7275ba8dda
25 changed files with 189 additions and 20 deletions
@@ -5,10 +5,11 @@ import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest } from '@angular/c
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Environment Configuration */
/** Custom Imports */
import { environment } from '../../../environments/environment';
import { SettingsService } from 'app/settings/settings.service';
/** Http request options headers. */
/** Http request (default) options headers. */
const httpOptions = {
headers: {
'Fineract-Platform-TenantId': environment.fineractPlatformTenantId
@@ -26,12 +27,15 @@ const twoFactorAccessTokenHeader = 'Fineract-Platform-TFA-Token';
@Injectable()
export class AuthenticationInterceptor implements HttpInterceptor {
constructor() {}
constructor(private settingsService: SettingsService) {}
/**
* Intercepts a Http request and sets the request headers.
*/
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
if (this.settingsService.tenantIdentifier) {
httpOptions.headers['Fineract-Platform-TenantId'] = this.settingsService.tenantIdentifier;
}
request = request.clone({ setHeaders: httpOptions.headers });
return next.handle(request);
}