diff --git a/Web/public/images/flag/icon-flag-sk.svg b/Web/public/images/flag/icon-flag-sk.svg
new file mode 100644
index 0000000..a04176d
--- /dev/null
+++ b/Web/public/images/flag/icon-flag-sk.svg
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/Web/src/app/app.route.guard.ts b/Web/src/app/app.route.guard.ts
index b97d3ca..41e594b 100755
--- a/Web/src/app/app.route.guard.ts
+++ b/Web/src/app/app.route.guard.ts
@@ -1,9 +1,18 @@
-import { CanActivateFn } from '@angular/router';
+import { CanActivateFn, Router } from '@angular/router';
import { inject } from '@angular/core';
-import { OAuthService } from 'angular-oauth2-oidc';
+import { AuthenticationService } from './services/authentication.service';
export const authGuard: CanActivateFn = (route, state) => {
- const authService = inject(OAuthService);
- return authService.hasValidAccessToken(); // returns boolean, Promise, or Observable
+ const auth = inject(AuthenticationService);
+ const router = inject(Router);
+
+ if (auth.hasValidAccessToken())
+ if (auth.profile)
+ return true;
+ else
+ return auth.handleCallback();
+
+ // redirect to the login page (UrlTree) so navigation does not fail silently
+ return router.parseUrl('/authentication/login');
};
diff --git a/Web/src/app/app.routes.ts b/Web/src/app/app.routes.ts
index e1b00b9..ed22f99 100755
--- a/Web/src/app/app.routes.ts
+++ b/Web/src/app/app.routes.ts
@@ -1,6 +1,7 @@
import { Routes } from '@angular/router';
import { BlankComponent } from './layouts/blank/blank.component';
import { FullComponent } from './layouts/full/full.component';
+import { authGuard } from './app.route.guard';
export const routes: Routes = [
{
@@ -17,13 +18,14 @@ export const routes: Routes = [
// loadChildren: () =>
// import('./pages/pages.routes').then((m) => m.PagesRoutes),
// },
- // {
- // path: 'dashboards',
- // loadChildren: () =>
- // import('../../../theme/packages/main/src/app/pages/dashboards/dashboards.routes').then(
- // (m) => m.DashboardsRoutes
- // ),
- // },
+ {
+ path: 'dashboard',
+ canActivate: [authGuard],
+ loadChildren: () =>
+ import('./pages/dashboard/dashboard.routes').then(
+ (m) => m.DashboardsRoutes
+ ),
+ },
// {
// path: 'forms',
// loadChildren: () =>
diff --git a/Web/src/app/config.ts b/Web/src/app/config.ts
index 5b6b252..aaf603a 100755
--- a/Web/src/app/config.ts
+++ b/Web/src/app/config.ts
@@ -17,9 +17,9 @@ export const defaults: AppSettings = {
sidenavOpened: false,
sidenavCollapsed: false,
boxed: true,
- horizontal: false,
- cardBorder: true,
+ horizontal: true,
+ cardBorder: false,
activeTheme: 'blue_theme',
- language: 'en-us',
+ language: 'sk-sk',
navPos: 'side',
};
diff --git a/Web/src/app/layouts/full/full.component.html b/Web/src/app/layouts/full/full.component.html
index dbdf6cf..7b10d45 100755
--- a/Web/src/app/layouts/full/full.component.html
+++ b/Web/src/app/layouts/full/full.component.html
@@ -101,11 +101,11 @@
-
+
-