File tree Expand file tree Collapse file tree 8 files changed +28
-30
lines changed
reader/_components/main-page/posts-list Expand file tree Collapse file tree 8 files changed +28
-30
lines changed Original file line number Diff line number Diff line change 2121 "index" : " src/index.html" ,
2222 "browser" : " src/main.ts" ,
2323 "allowedCommonJsDependencies" : [
24- " highlight.js"
24+ " highlight.js" ,
25+ " quill-delta" ,
26+ " whatwg-url" ,
27+ " @supabase/node-fetch"
2528 ],
2629 "polyfills" : [
2730 " zone.js"
4043 "scripts" : [],
4144 "server" : " src/main.server.ts" ,
4245 "prerender" : {
46+ "discoverRoutes" : false ,
4347 "routesFile" : " routes.txt"
4448 },
45- "ssr" : {
46- "entry" : " server.ts"
47- }
49+ "ssr" : true
4850 },
4951 "configurations" : {
5052 "production" : {
Original file line number Diff line number Diff line change 1+ /
Original file line number Diff line number Diff line change 11< div >
2- < router-outlet />
2+ <!-- < router-outlet/>-- >
33</ div >
Original file line number Diff line number Diff line change @@ -17,24 +17,14 @@ import { SupabaseService } from './services/supabase.service';
1717 templateUrl : './app.component.html' ,
1818 styleUrl : './app.component.scss' ,
1919} )
20- export class AppComponent implements OnInit {
21- cookieConsentService = inject ( CookieConsentService ) ;
22- viewContainerRef = inject ( ViewContainerRef ) ;
23-
24- supabase = inject ( SupabaseService ) ;
20+ export class AppComponent {
21+ // cookieConsentService = inject(CookieConsentService);
22+ // viewContainerRef = inject(ViewContainerRef);
2523
2624 constructor ( ) {
27- afterNextRender ( ( ) =>
28- this . cookieConsentService . showCookieConsent ( this . viewContainerRef ) ,
29- ) ;
30- }
31-
32- ngOnInit ( ) {
33- this . supabase . getClient
34- . from ( 'tags' )
35- . select ( '*' )
36- . then ( ( tags ) => {
37- console . log ( tags ) ;
38- } ) ;
25+ console . log ( 'AppComponent' ) ;
26+ // afterNextRender(() =>
27+ // this.cookieConsentService.showCookieConsent(this.viewContainerRef),
28+ // );
3929 }
4030}
Original file line number Diff line number Diff line change 11import { Routes } from '@angular/router' ;
22import { readerRoutes } from './reader/reader.routes' ;
3- import { authGuard } from './auth/_guards/auth.guard ' ;
3+ import { authAdminGuard } from './auth/_guards/authAdminGuard ' ;
44
55export const routes : Routes = [
66 {
@@ -9,12 +9,13 @@ export const routes: Routes = [
99 } ,
1010 {
1111 path : 'admin' ,
12- loadChildren : ( ) => import ( './admin/admin.routes' ) . then ( r => r . adminRoutes ) ,
12+ loadChildren : ( ) =>
13+ import ( './admin/admin.routes' ) . then ( ( r ) => r . adminRoutes ) ,
1314 title : 'Admin' ,
14- canActivate : [ authGuard ] ,
15+ canActivate : [ authAdminGuard ] ,
1516 } ,
1617 {
17- path :'**' ,
18- redirectTo : ''
18+ path : '**' ,
19+ redirectTo : '' ,
1920 } ,
2021] ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import { AuthService } from '../auth.service';
1616import { SupabaseService } from '../../services/supabase.service' ;
1717> >>> >>> 793 fe4a ( login fixed )
1818
19- export const authGuard : CanMatchFn = ( ) : boolean => {
19+ export const authAdminGuard : CanMatchFn = ( ) : boolean => {
2020 const supabaseService = inject ( SupabaseService ) ;
2121 const router = inject ( Router ) ;
2222< < < << << HEAD
@@ -31,10 +31,14 @@ export const authGuard: CanMatchFn = (): boolean => {
3131=== = ===
3232 const session = supabaseService . getSession ( ) ;
3333
34+ << < < < << HEAD :src / app / auth / _guards / auth . guard . ts
3435 // For now, just check if the user is authenticated
3536 // In a real application, you would check for specific roles in the user's metadata
3637 if ( session ) {
3738>>> > >>> 793 fe4a ( login fixed )
39+ === = ===
40+ if ( session ?. user ?. app_metadata ?. [ 'role' ] === Roles . ADMIN ) {
41+ >>> > >>> bc9c691 ( wip ) :src / app / auth / _guards / authAdminGuard . ts
3842 return true ;
3943 } else {
4044 router . navigate ( [ '/posts' ] ) ;
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export class PostsListComponent {
5252 this . onScroll . bind ( this ) ,
5353 ) ;
5454 } ) ;
55+ console . log ( 'init' ) ;
5556 }
5657
5758 onScroll ( event : Event ) {
Original file line number Diff line number Diff line change 1+ @use ' tailwindcss/utilities' ;
12@import " ../node_modules/quill/dist/quill.core.css" ;
23@import " ../node_modules/quill/dist/quill.snow.css" ;
34@import ' highlight.js/styles/atom-one-dark.css' ;
8081 @apply bg-gray-300 text-gray-500 cursor-not-allowed ;
8182}
8283
83- /* Import TailwindCSS */
84- @import ' tailwindcss/utilities' ;
8584
8685/* Additional styles for the card component */
8786.post-card {
You can’t perform that action at this time.
0 commit comments