Fix env loading and auth response verification

This commit is contained in:
ilham_gmail
2026-06-11 19:27:44 +07:00
parent 51411d7e76
commit ff5ff49597
3 changed files with 10 additions and 6 deletions
+2 -2
View File
@@ -582,8 +582,8 @@ function openAuthModal(mode){
resp = await fetch(endpoint, { method: 'POST', headers: buildHeaders(), body: JSON.stringify(payload), credentials: 'same-origin' });
jr = await resp.json().catch(()=>null);
}
if(!resp.ok || (jr && jr.success === false)){
showToast((jr && (jr.error || jr.status)) ? (jr.error || jr.status) : 'Gagal', 'error', 5000);
if(!resp.ok || !jr || jr.success === false){
showToast((jr && (jr.error || jr.status)) ? (jr.error || jr.status) : 'Gagal memproses respons dari server', 'error', 5000);
return;
}
if(mode === 'register'){