Changeset d2b1fa6
- Timestamp:
- 10/27/21 19:44:51 (3 years ago)
- Branches:
- dev
- Children:
- c205cc4
- Parents:
- 79ae621
- Location:
- src/Clients/Angular/finki-chattery/src/app
- Files:
-
- 3 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Clients/Angular/finki-chattery/src/app/app.component.ts
r79ae621 rd2b1fa6 1 1 import { Component, OnInit } from '@angular/core'; 2 import { LoaderService , RedirectService} from './core/services';2 import { LoaderService } from './core/services'; 3 3 4 4 @Component({ … … 8 8 }) 9 9 export class AppComponent implements OnInit { 10 constructor(public loader: LoaderService , private redirect: RedirectService) {}10 constructor(public loader: LoaderService) {} 11 11 12 ngOnInit(): void { 13 this.redirect.redirectLoggedInUser(); 14 } 12 ngOnInit(): void {} 15 13 } -
src/Clients/Angular/finki-chattery/src/app/core/guards/authorized-student.guard.ts
r79ae621 rd2b1fa6 1 1 import { Injectable } from '@angular/core'; 2 import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router'; 3 import { Observable } from 'rxjs'; 4 import { map } from 'rxjs/operators'; 2 import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; 5 3 import { ApplicationUserType } from 'src/app/shared-app/models'; 6 4 import { AuthService } from '../services'; … … 12 10 constructor(private auth: AuthService) {} 13 11 14 canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> { 15 return this.auth.currentUser().pipe( 16 map((user) => { 17 if (user?.userType === ApplicationUserType.Student) { 18 return true; 19 } 20 this.auth.login(); 21 return false; 22 }) 23 ); 12 canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { 13 return this.auth.user?.userType === ApplicationUserType.Student; 24 14 } 25 15 } -
src/Clients/Angular/finki-chattery/src/app/modules/questioning/questioning.routes.ts
r79ae621 rd2b1fa6 28 28 component: AskQuestionComponent, 29 29 canActivate: [AuthorizedStudentGuard] 30 } 30 }, 31 31 { 32 32 path: ':questionUid', -
src/Clients/Angular/finki-chattery/src/app/shared-app/models/index.ts
r79ae621 rd2b1fa6 4 4 export * from './category-state-view-models.models'; 5 5 export * from './question-state-enums.models'; 6 export * from './categories.models';
Note:
See TracChangeset
for help on using the changeset viewer.