- Operating System version: win10 1703
- Firebase SDK version: 4.4.0
- Firebase Product: auth
TypeError: Cannot read property 'indexOf' of null in auth.js after cleaing LocalStorage
Steps to reproduce:
I'm not sure if this is the expected behavior but after clearing the LocalStorage, I got an TypeError 'indexOf' of null. I expected null in case of missing LocalStorage user element.
Relevant Code:
@Injectable()
export class AuthService {
isAuthenticated: boolean;
constructor() {
firebase.auth().onAuthStateChanged((user: firebase.User) => {
if (user) {
this.isAuthenticated = true;
} else {
this.isAuthenticated = false;
}
});
}
}