About handling of the deadline of the token of firebase auth

时间:2019-05-24 01:19:22

标签: firebase authentication firebase-authentication

I use firebase auth for vue project. And I'm making a request to my own api server without using firebase cloud functions. I put the token obtained by firebase auth into localstorage and stored it in the header of the request, but when I verified the token with the api server, an error occurs when the token has expired. So, every time that requests from the client, the front end side checks whether token has not expired, and if it has expired, the app will try to refresh token method in the front end side, then add the new token to localstorage for the request header, but I am looking for a better way.

I would appreciate your favor if there is a known person. Thank you.

0 个答案:

没有答案