Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, OnInit } from '@angular/core';
- import { AuthService } from './auth.service';
- @Component({
- selector: 'app-root',
- templateUrl: './app.component.html',
- styleUrls: ['./app.component.css']
- })
- export class AppComponent implements OnInit {
- constructor(public auth: AuthService) {
- auth.handleAuthentication();
- }
- ngOnInit() {
- if (localStorage.getItem('isLoggedIn') === 'true') {
- this.auth.renewSession();
- }
- }
- }
Add Comment
Please, Sign In to add comment