fix: Resolve OTP verification instant transition and ensure bulletproof non-crashing conversation contact listing

This commit is contained in:
Hamza-Ayed
2026-08-27 12:09:09 +03:00
parent 9e9417f937
commit e16ad471c3
3 changed files with 21 additions and 6 deletions
+3 -1
View File
@@ -957,12 +957,14 @@ class TeacherPortal
if (res.ok && data.status === 'success' && data.data?.token) {
const token = data.data.token;
const user = data.data.user;
const profile = data.data.profile || {};
localStorage.setItem('saqel_teacher_jwt', token);
if (user) {
localStorage.setItem('saqel_teacher_user', JSON.stringify(user));
localStorage.setItem('saqel_teacher_user', JSON.stringify({ ...user, ...profile }));
}
document.cookie = "saqel_teacher_jwt=" + token + "; path=/; max-age=2592000; SameSite=Lax";
initWebSocket(token);
renderDashboard(user, profile);
await checkTeacherSession(token);
} else {
showError(data.message || 'رمز التحقق غير صحيح');