import { Component, OnInit } from '@angular/core';
import { TokenStorageService } from 'src/app/Services/token.service';

@Component({
  selector: 'app-header',
  templateUrl: './header.component.html',
  styleUrls: ['./header.component.scss'],
})
export class HeaderComponent {
  /**
   * @param  {TokenStorageService} privatetokenStorage
   */
  constructor(private tokenStorage: TokenStorageService) {}

  //logout() clears session storage; All user data is eradicated from it and page is reloaded
  logout() {
    this.tokenStorage.signOut();
    location.reload();
  }
}
