mail page imap connection mime 5 bis rest 16 login page 16

This commit is contained in:
alma 2025-04-16 00:23:18 +02:00
parent f04e826f41
commit ba94baba4b
2 changed files with 23 additions and 3 deletions

View File

@ -55,14 +55,25 @@ interface ImapConfig {
function getStoredCredentials(): StoredCredentials | null {
if (typeof window === 'undefined') {
// Server-side - we should never get here in a client-side request
console.log('Server-side credentials check - returning null');
return null;
}
// Client-side
const stored = localStorage.getItem('imapCredentials');
if (!stored) return null;
console.log('Stored credentials from localStorage:', stored);
if (!stored) {
console.log('No stored credentials found');
return null;
}
const credentials = JSON.parse(stored);
console.log('Parsed credentials:', {
...credentials,
password: '***'
});
return {
email: credentials.email,
password: credentials.password,

View File

@ -43,12 +43,21 @@ export default function LoginPage() {
}
// Store credentials in localStorage
localStorage.setItem('imapCredentials', JSON.stringify({
const credentials = {
email,
password,
host,
port: parseInt(port),
}));
};
console.log('Storing credentials:', {
...credentials,
password: '***'
});
localStorage.setItem('imapCredentials', JSON.stringify(credentials));
// Verify storage
const stored = localStorage.getItem('imapCredentials');
console.log('Verified stored credentials:', stored);
// Redirect to mail page
router.push('/mail');