| @@ -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({ | |||
| @@ -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, | |||
| @@ -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(); | |||
| @@ -0,0 +1,10 @@ | |||
| <div class="body"> | |||
| <article> | |||
| <h1>Page’s not available!</h1> | |||
| <div> | |||
| <p>Sorry for the inconvenience but you’re not allowed to visit this page <p> | |||
| Please feel free to <a href="https://sfmarkets.com.au">contact us</a>, otherwise please try other links</p> | |||
| <p>— The Team</p> | |||
| </div> | |||
| </article> | |||
| </div> | |||
| @@ -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; | |||
| } | |||
| @@ -0,0 +1,25 @@ | |||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||
| import { E403Component } from './e403.component'; | |||
| describe('E403Component', () => { | |||
| let component: E403Component; | |||
| let fixture: ComponentFixture<E403Component>; | |||
| beforeEach(async () => { | |||
| await TestBed.configureTestingModule({ | |||
| declarations: [ E403Component ] | |||
| }) | |||
| .compileComponents(); | |||
| }); | |||
| beforeEach(() => { | |||
| fixture = TestBed.createComponent(E403Component); | |||
| component = fixture.componentInstance; | |||
| fixture.detectChanges(); | |||
| }); | |||
| it('should create', () => { | |||
| expect(component).toBeTruthy(); | |||
| }); | |||
| }); | |||
| @@ -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 { | |||
| } | |||
| } | |||