From 97124d3f02eae08c760305e5691e0cc50b5510f1 Mon Sep 17 00:00:00 2001 From: Romain Verger Date: Wed, 9 Mar 2022 13:53:07 +0100 Subject: [PATCH] petites modifs --- src/app/app-routing.module.ts | 13 ++++++------- src/app/card-resto/card-resto.component.scss | 2 -- .../pages/filters-page/filters-page.component.html | 4 +++- .../pages/page-account/page-account.component.html | 1 + src/app/services/auth.guard.ts | 3 ++- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 332450b..b37f76b 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -15,16 +15,15 @@ import { PageAccountComponent } from './pages/page-account/page-account.componen const routes: Routes = [ { path: '', redirectTo: 'home', pathMatch: 'full' }, {path: 'signin', component: SigninComponent}, - {path: 'signup', component: SignupComponent}, - { path: 'home', component: HomePageComponent }, - { path: 'categories', component: ListCategoriesComponent }, - { path: 'favoris', component: FavorisUserComponent }, - { path: 'filtres', component: FiltersPageComponent }, - { path: 'profil', component: PageAccountComponent }, + { path: 'home',canActivate: [AuthGuard], component: HomePageComponent }, + { path: 'categories',canActivate: [AuthGuard], component: ListCategoriesComponent }, + { path: 'favoris',canActivate: [AuthGuard], component: FavorisUserComponent }, + { path: 'filtres',canActivate: [AuthGuard], component: FiltersPageComponent }, + { path: 'profil',canActivate: [AuthGuard], component: PageAccountComponent }, { path: 'Deconnexion', redirectTo: 'home'}, {path: 'restaurants', canActivate: [AuthGuard], /*data : {ROLE : "ROLE_ADMIN"},*/ component: RestoPageComponent}, {path: 'page-not-found',component: PageNotFoundComponent}, - {path: 'admin', component: AdminPageComponent}, + {path: 'admin',canActivate: [AuthGuard], component: AdminPageComponent}, {path: '**', redirectTo: 'page-not-found' } ]; diff --git a/src/app/card-resto/card-resto.component.scss b/src/app/card-resto/card-resto.component.scss index 0c641f9..6eadc29 100644 --- a/src/app/card-resto/card-resto.component.scss +++ b/src/app/card-resto/card-resto.component.scss @@ -34,8 +34,6 @@ } .accordion-button.collapsed { background: #CE0000; - - } .accordion-button.collapsed::after { diff --git a/src/app/pages/filters-page/filters-page.component.html b/src/app/pages/filters-page/filters-page.component.html index b07ef48..6da1e41 100644 --- a/src/app/pages/filters-page/filters-page.component.html +++ b/src/app/pages/filters-page/filters-page.component.html @@ -46,7 +46,9 @@
- Veuillez sélectionner le prix souhaité + Veuillez sélectionner la gamme de prix souhaitée +
+ 1(1 à 10) 2(11 à 20) 3(21 à 30) 4(31 à 20)
diff --git a/src/app/pages/page-account/page-account.component.html b/src/app/pages/page-account/page-account.component.html index 0e13e4c..9c7ecee 100644 --- a/src/app/pages/page-account/page-account.component.html +++ b/src/app/pages/page-account/page-account.component.html @@ -1,4 +1,5 @@
+

Vos informations personnelles

diff --git a/src/app/services/auth.guard.ts b/src/app/services/auth.guard.ts index 6001ce1..77c9e97 100644 --- a/src/app/services/auth.guard.ts +++ b/src/app/services/auth.guard.ts @@ -26,7 +26,7 @@ export class AuthGuard implements CanActivate { const decodedToken = jwt_decode(token); // TODO boucle sur le ['auth'] pour controler le role et en fonction de ca renvoyer true ou false ac redirection page403 - + console.log('decodedToken : ', decodedToken); @@ -37,6 +37,7 @@ export class AuthGuard implements CanActivate { // le token a expiré, je n'autorise pas l'accès this.tokenService.destroyToken(this.tokenKey); this.router.navigate(['signin']); + return false; } }