Compare commits
3 Commits
1708c1bead
...
6f6d033be3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f6d033be3 | ||
|
|
ff8536b448 | ||
|
|
60593f6c11 |
@@ -46,7 +46,7 @@ public class SecurityConfig {
|
||||
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll() // autoriser les preflight
|
||||
.requestMatchers("/api/auth/**").permitAll()
|
||||
.requestMatchers("/api/users/**").authenticated()
|
||||
.requestMatchers("/api/app/**").permitAll()
|
||||
.requestMatchers("/api/app/**").authenticated()
|
||||
.anyRequest().permitAll()
|
||||
)
|
||||
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||
|
||||
@@ -5,7 +5,7 @@ import {LoginComponent} from './pages/auth/login/login.component';
|
||||
import {ProfileComponent} from './pages/profile/profile.component';
|
||||
import {guestOnlyCanActivate, guestOnlyCanMatch} from './guards/guest-only.guard';
|
||||
import {adminOnlyCanActivate, adminOnlyCanMatch} from './guards/admin-only.guard';
|
||||
import {authOnlyCanMatch} from './guards/auth-only.guard';
|
||||
import {authOnlyCanActivate, authOnlyCanMatch} from './guards/auth-only.guard';
|
||||
import {PsAdminComponent} from './pages/admin/ps-admin/ps-admin.component';
|
||||
import {ProductsComponent} from './pages/products/products.component';
|
||||
|
||||
@@ -40,13 +40,13 @@ export const routes: Routes = [
|
||||
path: 'profile',
|
||||
component: ProfileComponent,
|
||||
canMatch: [authOnlyCanMatch],
|
||||
canActivate: [authOnlyCanMatch]
|
||||
canActivate: [authOnlyCanActivate]
|
||||
},
|
||||
{
|
||||
path: 'products',
|
||||
component: ProductsComponent,
|
||||
canMatch: [authOnlyCanMatch],
|
||||
canActivate: [authOnlyCanMatch]
|
||||
canMatch: [adminOnlyCanMatch],
|
||||
canActivate: [adminOnlyCanActivate]
|
||||
},
|
||||
{
|
||||
path: 'admin',
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
.container {
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user