Files
server/api/assets/preload-plugins/loginRedirect.js
T

13 lines
321 B
JavaScript

const redirectIfOnLogin = () => {
const path = window.location.pathname;
if (path == "/login" || path == "/register") {
window.location.reload();
}
}
const observer = new MutationObserver((mutations) => {
redirectIfOnLogin();
});
observer.observe(document, { subtree: true, childList: true })
redirectIfOnLogin();