Skip to content

Commit

Permalink
feat: fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Oct 20, 2023
1 parent ea4ad27 commit e121c2e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,14 @@ const session = (() => {
return {
login: async () => {
const token = localStorage.getItem('token');

if (token) {
const jwt = JSON.parse(atob(token.split('.')[1]));

if (jwt.exp < ((new Date()).getTime() / 1000)) {
await login();
} else {
await comment.ucapan();
}
} else {
await login();
Expand Down

0 comments on commit e121c2e

Please sign in to comment.