Skip to content

Commit

Permalink
feat: add token validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Sep 12, 2023
1 parent 32ea8ed commit 21f4b72
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ const like = async (button) => {
let token = localStorage.getItem('token') ?? '';
let id = button.getAttribute('data-uuid');

if (token.length == 0) {
alert('Terdapat kesalahan, token kosong !');
window.location.reload();
return;
}

let heart = button.firstElementChild.lastElementChild;
let info = button.firstElementChild.firstElementChild;

Expand Down

0 comments on commit 21f4b72

Please sign in to comment.