mirror of https://github.com/xfarrow/blink
update frontend javascript
This commit is contained in:
parent
9a79356778
commit
fc3356a7ee
|
@ -45,6 +45,7 @@
|
|||
|
||||
if(!display_name || !email || !password){
|
||||
alert('Please fill in all fields');
|
||||
return;
|
||||
}
|
||||
|
||||
const options = {
|
||||
|
|
|
@ -79,12 +79,16 @@
|
|||
}
|
||||
|
||||
const data = await response.json();
|
||||
if(response.ok){
|
||||
if (response.ok){
|
||||
populateFields(data.display_name, data.email);
|
||||
document.body.style.display = 'block'; // Show page
|
||||
}
|
||||
else if (response.status == 401){
|
||||
console.error(data.error);
|
||||
window.location.href = 'login.html';
|
||||
}
|
||||
else{
|
||||
alert(data.error);
|
||||
alert(`Unable to load profile. Error: ${data.error}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue