Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added redirect to dashboard page if loggedin
  • Loading branch information
ema14006 committed Apr 30, 2019
1 parent c210876 commit 828a466
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/app.component.ts
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { Router } from '@angular/router';

@Component({
selector: 'app-root',
Expand All @@ -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.