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/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 @@ +
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
+