【发布时间】:2020-02-11 13:50:51
【问题描述】:
为了提高我的 react 应用程序在页面重新加载时的性能,我将用户凭据存储在本地存储中并在注销时清除它们。但是这些天用户经常不会注销,并且用户凭据可以长时间保留在本地存储中,我认为这会导致一些安全漏洞吗?我不是 firebase 安全方面的专家,所以有人能解释一下它是否安全吗?
firebase.auth().onAuthStateChanged(user=>{
if (user) {
localStorage.setItem('user', JSON.stringify(user));
} else {
localStorage.removeItem('user');
}
})
【问题讨论】:
-
如果我没记错的话,firebase 默认会处理这个问题。没有?
标签: javascript firebase firebase-authentication