+ {
+ new Claim(ClaimTypes.Email, user.Email),
+ new Claim(ClaimTypes.GivenName, user.DisplayName)
+ };
+
+ var creds = new SigningCredentials(_key, SecurityAlgorithms.HmacSha512Signature);
+ var tokenDescriptor = new SecurityTokenDescriptor
+ {
+ Subject = new ClaimsIdentity(claims),
+ Expires = DateTime.Now.AddDays(7),
+ SigningCredentials = creds,
+ Issuer = _config["Token:Issuer"]
+ };
+
+ var tokenHandler = new JwtSecurityTokenHandler();
+ var token = tokenHandler.CreateToken(tokenDescriptor);
+ return tokenHandler.WriteToken(token);
+ }
+ }
+}
\ No newline at end of file
diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts
index a6d5bc3..12264f8 100644
--- a/client/src/app/app-routing.module.ts
+++ b/client/src/app/app-routing.module.ts
@@ -12,6 +12,7 @@ const routes: Routes = [
{path: 'not-found', component: NotFoundComponent, data: {breadcrumb: 'Not Found'}},
{path: 'shop', loadChildren: ()=> import('./shop/shop.module').then(mod => mod.ShopModule), data: {breadcrumb: 'Shop'}},
{path: 'basket', loadChildren: ()=> import('./basket/basket.module').then(mod => mod.BasketModule), data: {breadcrumb: 'Shopping Cart'}},
+ {path: 'checkout', loadChildren: ()=> import('./checkout/checkout.module').then(mod => mod.CheckoutModule), data: {breadcrumb: 'Checkout'}},
{path: '**', redirectTo: 'not-found', pathMatch: 'full'}
];
diff --git a/client/src/app/checkout/checkout-routing.module.ts b/client/src/app/checkout/checkout-routing.module.ts
new file mode 100644
index 0000000..54b0bb9
--- /dev/null
+++ b/client/src/app/checkout/checkout-routing.module.ts
@@ -0,0 +1,18 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { CheckoutComponent } from './checkout.component';
+import { RouterModule, Routes } from '@angular/router';
+
+const routes: Routes = [
+ {path: '', component: CheckoutComponent}
+]
+
+@NgModule({
+ declarations: [],
+ imports: [
+ CommonModule,
+ RouterModule.forChild(routes)
+ ],
+ exports: [RouterModule]
+})
+export class CheckoutRoutingModule { }
diff --git a/client/src/app/checkout/checkout.component.html b/client/src/app/checkout/checkout.component.html
new file mode 100644
index 0000000..abf724e
--- /dev/null
+++ b/client/src/app/checkout/checkout.component.html
@@ -0,0 +1,3 @@
+
+
Only authorized users should be able to see this.
+
diff --git a/client/src/app/checkout/checkout.component.scss b/client/src/app/checkout/checkout.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/client/src/app/checkout/checkout.component.ts b/client/src/app/checkout/checkout.component.ts
new file mode 100644
index 0000000..b0398d6
--- /dev/null
+++ b/client/src/app/checkout/checkout.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-checkout',
+ templateUrl: './checkout.component.html',
+ styleUrls: ['./checkout.component.scss']
+})
+export class CheckoutComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
diff --git a/client/src/app/checkout/checkout.module.ts b/client/src/app/checkout/checkout.module.ts
new file mode 100644
index 0000000..cacddad
--- /dev/null
+++ b/client/src/app/checkout/checkout.module.ts
@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { CheckoutComponent } from './checkout.component';
+import { CheckoutRoutingModule } from './checkout-routing.module';
+
+
+
+@NgModule({
+ declarations: [
+ CheckoutComponent
+ ],
+ imports: [
+ CommonModule,
+ CheckoutRoutingModule
+ ]
+})
+export class CheckoutModule { }
diff --git a/client/src/app/checkout/checkout.service.ts b/client/src/app/checkout/checkout.service.ts
new file mode 100644
index 0000000..d9285b6
--- /dev/null
+++ b/client/src/app/checkout/checkout.service.ts
@@ -0,0 +1,9 @@
+import { Injectable } from '@angular/core';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class CheckoutService {
+
+ constructor() { }
+}