diff --git a/apps/mina-sidor-fa/src/app/app-routing.module.ts b/apps/mina-sidor-fa/src/app/app-routing.module.ts
index 2d8c574..a33cf95 100644
--- a/apps/mina-sidor-fa/src/app/app-routing.module.ts
+++ b/apps/mina-sidor-fa/src/app/app-routing.module.ts
@@ -53,10 +53,15 @@ const routes: Routes = [
canActivate: [AuthGuard],
},
{
- path: 'logout',
+ path: 'logga-ut',
data: { title: 'Logga ut' },
loadChildren: () => import('./pages/logout/logout.module').then(m => m.LogoutModule),
},
+ {
+ path: 'mitt-konto',
+ data: { title: 'Mitt konto' },
+ loadChildren: () => import('./pages/my-account/my-account.module').then(m => m.MyAccountModule),
+ },
];
if (!environment.production) {
diff --git a/apps/mina-sidor-fa/src/app/pages/logout/logout.component.html b/apps/mina-sidor-fa/src/app/pages/logout/logout.component.html
index ad20afd..e69de29 100644
--- a/apps/mina-sidor-fa/src/app/pages/logout/logout.component.html
+++ b/apps/mina-sidor-fa/src/app/pages/logout/logout.component.html
@@ -1,8 +0,0 @@
-
-
-
diff --git a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.html b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.html
new file mode 100644
index 0000000..f6ba78c
--- /dev/null
+++ b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.html
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.scss b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.spec.ts b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.spec.ts
new file mode 100644
index 0000000..888b027
--- /dev/null
+++ b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { MyAccountComponent } from './my-account.component';
+
+describe('MyAccountComponent', () => {
+ let component: MyAccountComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(
+ waitForAsync(() => {
+ void TestBed.configureTestingModule({
+ schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
+ declarations: [MyAccountComponent],
+ }).compileComponents();
+ })
+ );
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(MyAccountComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.ts b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.ts
new file mode 100644
index 0000000..bfd88e3
--- /dev/null
+++ b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.ts
@@ -0,0 +1,9 @@
+import { ChangeDetectionStrategy, Component } from '@angular/core';
+
+@Component({
+ selector: 'msfa-my-account',
+ templateUrl: './my-account.component.html',
+ styleUrls: ['./my-account.component.scss'],
+ changeDetection: ChangeDetectionStrategy.OnPush,
+})
+export class MyAccountComponent {}
diff --git a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.module.ts b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.module.ts
new file mode 100644
index 0000000..36a2357
--- /dev/null
+++ b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.module.ts
@@ -0,0 +1,18 @@
+import { DigiNgLinkInternalModule } from '@af/digi-ng/_link/link-internal';
+import { CommonModule } from '@angular/common';
+import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
+import { RouterModule } from '@angular/router';
+import { LayoutModule } from '@msfa-shared/components/layout/layout.module';
+import { MyAccountComponent } from './my-account.component';
+
+@NgModule({
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ declarations: [MyAccountComponent],
+ imports: [
+ CommonModule,
+ RouterModule.forChild([{ path: '', component: MyAccountComponent }]),
+ LayoutModule,
+ DigiNgLinkInternalModule,
+ ],
+})
+export class MyAccountModule {}
diff --git a/apps/mina-sidor-fa/src/app/shared/components/layout/components/navigation/navigation.component.html b/apps/mina-sidor-fa/src/app/shared/components/layout/components/navigation/navigation.component.html
index d07b87d..76e1e24 100644
--- a/apps/mina-sidor-fa/src/app/shared/components/layout/components/navigation/navigation.component.html
+++ b/apps/mina-sidor-fa/src/app/shared/components/layout/components/navigation/navigation.component.html
@@ -6,10 +6,10 @@
-
-
+
-
diff --git a/apps/mina-sidor-fa/src/app/shared/services/api/authentication.service.ts b/apps/mina-sidor-fa/src/app/shared/services/api/authentication.service.ts
index fdefeda..e9de472 100644
--- a/apps/mina-sidor-fa/src/app/shared/services/api/authentication.service.ts
+++ b/apps/mina-sidor-fa/src/app/shared/services/api/authentication.service.ts
@@ -1,5 +1,6 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
+import { Router } from '@angular/router';
import { environment } from '@msfa-environment';
import { AuthenticationResponse } from '@msfa-models/api/authentication.response.model';
import { Authentication, mapAuthApiResponseToAuthenticationResult } from '@msfa-models/authentication.model';
@@ -69,7 +70,7 @@ export class AuthenticationService {
return this._token$.getValue();
}
- constructor(private httpClient: HttpClient) {
+ constructor(private httpClient: HttpClient, private router: Router) {
const localStorageData = this._getLocalStorageData();
if (localStorageData) {
@@ -82,7 +83,9 @@ export class AuthenticationService {
localStorage.removeItem('id_token');
localStorage.removeItem('expires_at');
- if (environment.environment !== 'local') {
+ if (environment.environment === 'local') {
+ void this.router.navigateByUrl(environment.logoutUrl);
+ } else {
document.location.href = environment.logoutUrl;
}
}
diff --git a/apps/mina-sidor-fa/src/environments/environment.ts b/apps/mina-sidor-fa/src/environments/environment.ts
index c04e3d5..a0313c2 100644
--- a/apps/mina-sidor-fa/src/environments/environment.ts
+++ b/apps/mina-sidor-fa/src/environments/environment.ts
@@ -4,7 +4,7 @@ export const environment: Environment = {
environment: 'local',
clientId: '',
loginUrl: '/mock-login',
- logoutUrl: '',
+ logoutUrl: '/mock-login',
production: false,
api: {
url: '/api',