Fix encryption not working after restarting
This commit is contained in:
@@ -32,6 +32,17 @@ const AppContent: FC = () => {
|
||||
setIsAuthenticated(true);
|
||||
setIsAdmin(!!meRes.is_admin);
|
||||
setUsername(meRes.username || null);
|
||||
|
||||
// Check if user data is unlocked
|
||||
if (!meRes.data_unlocked) {
|
||||
// Data is locked - user needs to re-authenticate
|
||||
// For now, we'll just log this and let the user know they need to log in again
|
||||
console.warn("User data is locked - re-authentication required");
|
||||
setIsAuthenticated(false);
|
||||
setIsAdmin(false);
|
||||
setUsername(null);
|
||||
document.cookie = "jwt=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
setIsAuthenticated(false);
|
||||
|
||||
Reference in New Issue
Block a user