import { Injectable } from '@angular/core' ; @ Injectable ( { providedIn : 'root' } ) export class TokenService { token : string ; username : string ; created : string ; secret : string ; wsseToken : string ; constructor ( ) { } hasAuthorizationToken ( ) { const hasToken = ! ! this . token ; return hasToken ; } getAuthorizationToken ( ) { const token = localStorage . getItem ( 'access_token' ) ; this . token = token ; return this . token ; } setAuthorizationToken ( token ) { this . token = token ; localStorage . setItem ( 'access_token' , this . token ) ; } cleanAuthorizationToken ( ) { this . token = null ; localStorage . removeItem ( 'access_token' ) ; } }