I'm working on setting up the initial state for a dataStore in an Angular2 app and I have the following code snippet. The issue is that INIT_STATE.token
is currently showing as "null"
instead of just null
.
export interface IAuthState{
authenticated: boolean,
token?: any
}
const INIT_STATE: IAuthState = {
authenticated: localStorage.getItem('id_token') ? true : false,
token: localStorage.getItem('id_token') ? localStorage.getItem('id_token') : null
}