This commit is contained in:
Generated
+1053
-1053
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,7 @@ import { AuthGuard } from './auth.guard';
|
||||
import { NotAuthGuard } from './notAuth.guard';
|
||||
import { ParentAuthGuard } from './parentAuth.guard';
|
||||
import { MapComponent } from './views/components/map/map.component';
|
||||
import {VerifyEmailComponent} from "./views/components/verify-email/verify-email.component";
|
||||
|
||||
|
||||
export const routes: Routes = [
|
||||
@@ -90,6 +91,10 @@ export const routes: Routes = [
|
||||
{
|
||||
path: 'map/:id',
|
||||
component: MapComponent
|
||||
},
|
||||
{
|
||||
path: 'verify/:token',
|
||||
component: VerifyEmailComponent
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import {ActivatedRoute} from "@angular/router";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {ConsoleService} from "../../../console.service";
|
||||
import {ApiClientService} from "../../../../api/index";
|
||||
|
||||
@@ -17,7 +17,7 @@ export class VerifyEmailComponent implements OnInit {
|
||||
|
||||
verified:boolean = false;
|
||||
|
||||
constructor(private consoleService: ConsoleService, private route: ActivatedRoute, private apiClientService:ApiClientService) { }
|
||||
constructor(private consoleService: ConsoleService, private route: ActivatedRoute, private apiClientService:ApiClientService, private router: Router) { }
|
||||
|
||||
ngOnInit() {
|
||||
// Fetch token from url
|
||||
@@ -29,8 +29,13 @@ export class VerifyEmailComponent implements OnInit {
|
||||
this.loading = true;
|
||||
this.apiClientService.verifyUserEmail(this.token).subscribe(result => {
|
||||
this.consoleService.log("Email verification received.");
|
||||
this.loading = false;
|
||||
this.verified = true;
|
||||
this.loading = false;
|
||||
|
||||
setTimeout(() => {
|
||||
this.router.navigate(['/pages/login']);
|
||||
}, 1000);
|
||||
|
||||
// this.user.next(result.body);
|
||||
}, error => {
|
||||
this.loading = false;
|
||||
|
||||
Reference in New Issue
Block a user