v0.7.20 - Fix automatic relay connection for restored authentication state
This commit is contained in:
18
api/index.js
18
api/index.js
@@ -560,9 +560,21 @@ async function restoreAuthenticationState(pubkey) {
|
|||||||
showProfileInHeader();
|
showProfileInHeader();
|
||||||
loadUserProfile();
|
loadUserProfile();
|
||||||
|
|
||||||
// Note: Configuration fetching now requires explicit relay connection
|
// Automatically attempt to connect to relay after restoring authentication state
|
||||||
// User must connect to relay manually after login
|
console.log('✅ Authentication state restored - automatically attempting to connect to relay...');
|
||||||
console.log('✅ Authentication state restored - connect to relay to fetch configuration');
|
setTimeout(() => {
|
||||||
|
connectToRelay().catch(error => {
|
||||||
|
console.log(`Automatic relay connection failed: ${error.message}`);
|
||||||
|
// Check if this is an authentication-related error
|
||||||
|
if (error.message.includes('authentication') ||
|
||||||
|
error.message.includes('auth') ||
|
||||||
|
error.message.includes('permission') ||
|
||||||
|
error.message.includes('unauthorized') ||
|
||||||
|
error.message.includes('forbidden')) {
|
||||||
|
showAuthenticationWarning(error.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 500); // Small delay to allow profile loading to complete
|
||||||
|
|
||||||
console.log('✅ Authentication state restored successfully');
|
console.log('✅ Authentication state restored successfully');
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user