Fix: logout redirect to homepage issue

This commit is contained in:
hyzen
2026-06-10 07:24:02 +05:30
parent 425601481e
commit 60907ed4c8
65 changed files with 67 additions and 65 deletions

View File

@@ -44,4 +44,4 @@ Blog posts</button></div></div></div></div><nav class="menu language"><ul class=
<a href=/uninotes/s1/ge-dcm1106/unit1/>Unit 1</a>
<span>Live</span></nav><div class=uninotes-meta><span class=uninotes-meta__pill>S1</span>
<span class=uninotes-meta__pill>GE DCM1106</span>
<span class="uninotes-meta__pill uninotes-meta__pill--live">Live</span></div><h1>Unit 1</h1><details class=toc><summary class=toc__summary>Table of Contents</summary><nav id=TableOfContents><ul><li><ul><li><a href=#april-12-2026><em><strong>April 12, 2026</strong></em></a></li></ul></li><li><a href=#theories-on-the-origin-of-language>Theories on the Origin of Language</a><ul><li><a href=#types-of-theories>Types of Theories</a></li></ul></li></ul></nav></details><h3 class=heading id=april-12-2026><em><strong>April 12, 2026</strong></em><span class=heading__anchor> <a href=#april-12-2026>#</a></span></h3><h2 class=heading id=theories-on-the-origin-of-language>Theories on the Origin of Language<span class=heading__anchor> <a href=#theories-on-the-origin-of-language>#</a></span></h2><h3 class=heading id=types-of-theories>Types of Theories<span class=heading__anchor> <a href=#types-of-theories>#</a></span></h3><p>A) Divine.<br>B) Bow-Bow.<br>C) Pooh-Pooh.<br>D) Ding-Dong.<br>E) Gesture.<br>F) Yo-He-Ho.<br>G) Musical.<br>H) Tool-Making.<br>I) Evolutionary.<br>J) Symbolic.<br>K) Contemporary Perspective.</p></main><footer class=footer><p class=footer__copyright-notice>&copy; <a href=https://freedoms4.org>freedoms4.org</a> <a href=/changelog/>Changelog</a></p><p class=footer__theme-info>Built with <a href=https://gohugo.io>Hugo</a> and based on <a href=https://github.com/CyrusYip/hugo-theme-yue>Yue</a> theme</p></footer><script>(function(){document.querySelectorAll(".menu__item").forEach(function(e){var t=e.querySelector("a");t&&t.getAttribute("href")==="/uninotes/"&&e.classList.add("menu__item--uninotes")})})()</script><script>(function(){var e=document.getElementById("theme-toggle");if(!e)return;function t(){var e=localStorage.getItem("theme");return e?e:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function n(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("theme",e)}n(t()),e.addEventListener("click",function(){var e=document.documentElement.getAttribute("data-theme")||t();n(e==="dark"?"light":"dark")})})()</script><script>(function(){var t="https://backend.freedoms4.org/auth.php",e=localStorage.getItem("f4_username");if(!e)return;function n(e){var t,n,o,a,r,i=document.querySelector(".brand__auth");i&&!i.querySelector(".brand__auth-user")&&(i.classList.add("brand__auth--loggedin"),t=document.createElement("div"),t.className="brand__auth-user",n=document.createElement("button"),n.className="brand__auth-user-btn",n.setAttribute("aria-label","Account menu"),r=document.createElement("span"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>',n.appendChild(r.firstChild),n.appendChild(document.createTextNode(" "+e)),a=document.createElement("div"),a.className="brand__auth-user-dropdown",o=document.createElement("button"),o.className="brand__auth-user-logout",o.textContent="Log Out",o.addEventListener("click",s),a.appendChild(o),t.appendChild(n),t.appendChild(a),i.appendChild(t),n.addEventListener("click",function(e){e.stopPropagation(),t.classList.toggle("is-open")}),document.addEventListener("click",function(){t.classList.remove("is-open")}))}function s(){fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({action:"logout"})}).finally(function(){localStorage.removeItem("f4_username"),window.location.href="/"})}n(e)})()</script><script>(function(){var t,e=document.querySelector(".rss-subscribe");if(!e)return;t=e.querySelector(".rss-subscribe__btn"),t.addEventListener("click",function(t){t.stopPropagation(),e.classList.toggle("is-open")}),document.addEventListener("click",function(t){e.contains(t.target)||e.classList.remove("is-open")}),e.querySelectorAll(".rss-subscribe__item").forEach(function(t){t.addEventListener("click",function(n){n.stopPropagation();var s,o=t.getAttribute("data-rss-url"),a=t.textContent;function i(){t.textContent="Copied!",setTimeout(function(){t.textContent=a,e.classList.remove("is-open")},1200)}try{s=document.createElement("textarea"),s.value=o,s.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none;",document.body.appendChild(s),s.focus(),s.select(),document.execCommand("copy"),document.body.removeChild(s),i()}catch{navigator.clipboard&&navigator.clipboard.writeText(o).then(i).catch(function(){t.textContent=o})}})})})()</script><script src=/js/session-check.js></script></body></html>
<span class="uninotes-meta__pill uninotes-meta__pill--live">Live</span></div><h1>Unit 1</h1><details class=toc><summary class=toc__summary>Table of Contents</summary><nav id=TableOfContents><ul><li><ul><li><a href=#april-12-2026><em><strong>April 12, 2026</strong></em></a></li></ul></li><li><a href=#theories-on-the-origin-of-language>Theories on the Origin of Language</a><ul><li><a href=#types-of-theories>Types of Theories</a></li></ul></li></ul></nav></details><h3 class=heading id=april-12-2026><em><strong>April 12, 2026</strong></em><span class=heading__anchor> <a href=#april-12-2026>#</a></span></h3><h2 class=heading id=theories-on-the-origin-of-language>Theories on the Origin of Language<span class=heading__anchor> <a href=#theories-on-the-origin-of-language>#</a></span></h2><h3 class=heading id=types-of-theories>Types of Theories<span class=heading__anchor> <a href=#types-of-theories>#</a></span></h3><p>A) Divine.<br>B) Bow-Bow.<br>C) Pooh-Pooh.<br>D) Ding-Dong.<br>E) Gesture.<br>F) Yo-He-Ho.<br>G) Musical.<br>H) Tool-Making.<br>I) Evolutionary.<br>J) Symbolic.<br>K) Contemporary Perspective.</p></main><footer class=footer><p class=footer__copyright-notice>&copy; <a href=https://freedoms4.org>freedoms4.org</a> <a href=/changelog/>Changelog</a></p><p class=footer__theme-info>Built with <a href=https://gohugo.io>Hugo</a> and based on <a href=https://github.com/CyrusYip/hugo-theme-yue>Yue</a> theme</p></footer><script>(function(){document.querySelectorAll(".menu__item").forEach(function(e){var t=e.querySelector("a");t&&t.getAttribute("href")==="/uninotes/"&&e.classList.add("menu__item--uninotes")})})()</script><script>(function(){var e=document.getElementById("theme-toggle");if(!e)return;function t(){var e=localStorage.getItem("theme");return e?e:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function n(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("theme",e)}n(t()),e.addEventListener("click",function(){var e=document.documentElement.getAttribute("data-theme")||t();n(e==="dark"?"light":"dark")})})()</script><script>(function(){var t="https://backend.freedoms4.org/auth.php",e=localStorage.getItem("f4_username");if(!e)return;function n(e){var t,n,o,a,r,i=document.querySelector(".brand__auth");i&&!i.querySelector(".brand__auth-user")&&(i.classList.add("brand__auth--loggedin"),t=document.createElement("div"),t.className="brand__auth-user",n=document.createElement("button"),n.className="brand__auth-user-btn",n.setAttribute("aria-label","Account menu"),r=document.createElement("span"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>',n.appendChild(r.firstChild),n.appendChild(document.createTextNode(" "+e)),a=document.createElement("div"),a.className="brand__auth-user-dropdown",o=document.createElement("button"),o.className="brand__auth-user-logout",o.textContent="Log Out",o.addEventListener("click",s),a.appendChild(o),t.appendChild(n),t.appendChild(a),i.appendChild(t),n.addEventListener("click",function(e){e.stopPropagation(),t.classList.toggle("is-open")}),document.addEventListener("click",function(){t.classList.remove("is-open")}))}function s(){fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({action:"logout"})}).finally(function(){localStorage.removeItem("f4_username"),localStorage.removeItem("f4_login_time"),localStorage.removeItem("f4_session_fails"),window.location.reload()})}n(e)})()</script><script>(function(){var t,e=document.querySelector(".rss-subscribe");if(!e)return;t=e.querySelector(".rss-subscribe__btn"),t.addEventListener("click",function(t){t.stopPropagation(),e.classList.toggle("is-open")}),document.addEventListener("click",function(t){e.contains(t.target)||e.classList.remove("is-open")}),e.querySelectorAll(".rss-subscribe__item").forEach(function(t){t.addEventListener("click",function(n){n.stopPropagation();var s,o=t.getAttribute("data-rss-url"),a=t.textContent;function i(){t.textContent="Copied!",setTimeout(function(){t.textContent=a,e.classList.remove("is-open")},1200)}try{s=document.createElement("textarea"),s.value=o,s.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none;",document.body.appendChild(s),s.focus(),s.select(),document.execCommand("copy"),document.body.removeChild(s),i()}catch{navigator.clipboard&&navigator.clipboard.writeText(o).then(i).catch(function(){t.textContent=o})}})})})()</script><script src=/js/session-check.js></script></body></html>