Guest User

Untitled

a guest
Dec 12th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import { Component, OnInit } from '@angular/core';
  2. import { AuthService } from './auth.service';
  3.  
  4. @Component({
  5. selector: 'app-root',
  6. templateUrl: './app.component.html',
  7. styleUrls: ['./app.component.css']
  8. })
  9. export class AppComponent implements OnInit {
  10.  
  11. constructor(public auth: AuthService) {
  12. auth.handleAuthentication();
  13. }
  14.  
  15. ngOnInit() {
  16. if (localStorage.getItem('isLoggedIn') === 'true') {
  17. this.auth.renewSession();
  18. }
  19. }
  20.  
  21. }
Add Comment
Please, Sign In to add comment