Skip to content
Permalink
Browse files

added redirect to dashboard page if loggedin

  • Loading branch information
ema14006 committed Apr 30, 2019
1 parent c210876 commit 828a466da7afffed48e4110cd4daee3bff1bff80
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/app/app.component.ts
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { Router } from '@angular/router';

@Component({
selector: 'app-root',
@@ -7,4 +8,10 @@ import { Component } from '@angular/core';
})
export class AppComponent {
title = 'frontend';

constructor(router: Router) {
if (localStorage.getItem('auth_token') !== null && router.url == '/') {
router.navigate(['/generator-search']);
}
}
}

0 comments on commit 828a466

Please sign in to comment.
You can’t perform that action at this time.