且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

错误:Firebase ID令牌已过期

更新时间:2023-02-16 09:44:17

令牌通常会在一个小时后过期. getIdToken 将刷新缓存的令牌(如果已过期).当您需要将令牌发送到服务器时,请确保始终在客户端上调用它.如果您缓存令牌并始终将其发送到后端,则令牌将在某个时候过期.

The token expires after typically an hour. getIdToken will refresh the cached token if it is expired. Make sure you always call that on the client when you need to send the token to your server. If you cache the token and always send it to your backend, it will be expired at some point.

以防万一,请确保您的服务器时钟已同步.不太可能,但是由于某些原因您的时钟可能不同步.

Also just in case, ensure your server clock is synchronized. It is unlikely but your clock could be out of sync for some reason.