Skip to content

Commit

Permalink
feat: closes #90; redirect to login when non auth like
Browse files Browse the repository at this point in the history
  • Loading branch information
MagneticNeedle committed Oct 3, 2022
1 parent 5e1e845 commit 36a7774
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bfportal/bfportal/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,13 @@
const id = elem.getAttribute("like_count_container");
fetch(`/api/like/${id}/`).then(
function (resp) {
return resp.json()
console.log(resp.url)
if(resp.redirected){
document.location = `${resp.url.split("=")[0]}=${document.location.pathname}`
} else {
return resp.json()
}

}
).then(function (data) {
const fav_containers = document.querySelectorAll(`[fav_count_container='${id}']`),
Expand Down

0 comments on commit 36a7774

Please sign in to comment.