I'm working on a very uncritical project. Therefore I want to have the best possible user experience while authentication meaning: log in once and stay logged in forever.
I managed to get firebase authentication working. However the token expires after one hour.
I read that the refresh token never expires. (see here ) Therefore I thought of putting it in the local storage and use it to retrieve a new access token. Is that correct?
If this was the case: why is there no
this.afAuth.auth.getTokenWithRefreshToken()
Do I need to use
this.afAuth.auth.signInWithCustomToken(MyRefreshTokenFromLocalStorage)
this function?
What does setting the persistence to LOCAL actually do? In the docs it says you will be logged in forever (even if browser is closed and reopened) but thats not true? "This includes the ability to specify whether a signed in user should be indefinitely persisted until explicit sign out, cleared when the window is closed or cleared on page reload." (firebase docs)
I tried quite a few things including a third-party auth-provider but I never know if its not working or if I'm not smart enough. So if someone could give me a direction what might work and where I could focus my tries and errors I'd be super happy.