mirror of
https://github.com/xfarrow/blink
synced 2025-06-27 09:03:02 +02:00
Following API best practices
This commit is contained in:
@ -43,7 +43,7 @@
|
||||
alert('Please fill in all fields');
|
||||
return;
|
||||
}
|
||||
const response = await fetch(`${API_URL}/login`, {
|
||||
const response = await fetch(`${API_URL}/persons/me/token`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
email: email,
|
||||
@ -59,7 +59,7 @@
|
||||
if (response.ok) {
|
||||
console.log(`Login was successful. Token is ${data.token}`);
|
||||
document.cookie = `token=${data.token};`;
|
||||
window.location.href = 'userprofile.html?id=myself';
|
||||
window.location.href = 'userprofile.html?id=me';
|
||||
} else {
|
||||
alert(data.error);
|
||||
}
|
||||
|
Reference in New Issue
Block a user