diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index f573b5b..ff6a63e 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -13,6 +13,7 @@ import {BrokerRewardComponent} from './broker-reward/broker-reward.component'; import {BrokerProfileComponent} from './broker-profile/broker-profile.component'; import {ClientLoanListComponent} from './client-loan-list/client-loan-list.component'; import {ClientProfileComponent} from './client-profile/client-profile.component'; +import {E403Component} from './e403/e403.component'; const routes: Routes = [ @@ -31,6 +32,7 @@ const routes: Routes = [ {path : 'broker-profile', component: BrokerProfileComponent, }, {path : 'client-loan-list', component: ClientLoanListComponent, }, {path : 'client-profile', component: ClientProfileComponent, }, + {path : 'e403', component: E403Component, }, ]; @NgModule({ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 4dcb9b2..3dc352e 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -70,6 +70,7 @@ import { BrokerRewardComponent } from './broker-reward/broker-reward.component'; import { BrokerProfileComponent } from './broker-profile/broker-profile.component'; import { ClientLoanListComponent } from './client-loan-list/client-loan-list.component'; import { ClientProfileComponent } from './client-profile/client-profile.component'; +import { E403Component } from './e403/e403.component'; @@ -110,7 +111,8 @@ import { ClientProfileComponent } from './client-profile/client-profile.componen BrokerRewardComponent, BrokerProfileComponent, ClientLoanListComponent, - ClientProfileComponent + ClientProfileComponent, + E403Component ], imports: [ BrowserModule, diff --git a/src/app/auth/auth.component.ts b/src/app/auth/auth.component.ts index 6e831d5..c5774c1 100644 --- a/src/app/auth/auth.component.ts +++ b/src/app/auth/auth.component.ts @@ -43,11 +43,25 @@ export class AuthComponent implements OnInit, OnDestroy{ this.authService.login(this.userForm.value.email, this.userForm.value.password); } - public onLogin(rsp: apiV1LoginResponse) { + public onLogin(rsp: apiV1LoginResponse): void { this.loading = false; // console.log ('found login ' , rsp ); if (rsp.login) { - this.router.navigate(['/dashboard']); + switch ( rsp.role ) { + case 'admin': + this.router.navigate(['/dashboard']); + break; + case 'broker': + this.router.navigate(['/broker-loan-list']); + break; + case 'user': + this.router.navigate(['/client-loan-list']); + break; + default: + this.router.navigate(['/e403']); + break; + } + } else { this.show(); diff --git a/src/app/e403/e403.component.html b/src/app/e403/e403.component.html new file mode 100644 index 0000000..3832c47 --- /dev/null +++ b/src/app/e403/e403.component.html @@ -0,0 +1,10 @@ +
+
+

Page’s not available!

+
+

Sorry for the inconvenience but you’re not allowed to visit this page

+ Please feel free to contact us, otherwise please try other links

+

— The Team

+
+
+
diff --git a/src/app/e403/e403.component.scss b/src/app/e403/e403.component.scss new file mode 100644 index 0000000..20aa7a3 --- /dev/null +++ b/src/app/e403/e403.component.scss @@ -0,0 +1,38 @@ +div.body { + text-align: center; + padding: 150px; + display: table; + width: 100%; + height: 100vh; + opacity: 0.95; + background: url('../../assets/img/body_bg.jpg') no-repeat center center fixed; + background-size: cover; +} + +h1 { + font-size: 50px; +} + +body { + font: 20px Helvetica, sans-serif; + color: #333; +} + +article { + display: block; + text-align: left; + width: 650px; + margin: 0 auto; +} + +a { + color: #dc8100; + text-decoration: none; +} + +a:hover { + color: #333; + text-decoration: none; +} + + diff --git a/src/app/e403/e403.component.spec.ts b/src/app/e403/e403.component.spec.ts new file mode 100644 index 0000000..09dbcae --- /dev/null +++ b/src/app/e403/e403.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { E403Component } from './e403.component'; + +describe('E403Component', () => { + let component: E403Component; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ E403Component ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(E403Component); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/e403/e403.component.ts b/src/app/e403/e403.component.ts new file mode 100644 index 0000000..1650191 --- /dev/null +++ b/src/app/e403/e403.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-e403', + templateUrl: './e403.component.html', + styleUrls: ['./e403.component.scss'] +}) +export class E403Component implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +}