Redirect to custom login page when client navigates to /login or /register

This commit is contained in:
Madeline 2022-07-09 18:58:17 +10:00
parent 7b59049a89
commit 879bfa7391

View File

@ -0,0 +1,13 @@
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();