mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-23 01:45:23 +00:00
Redirect to custom login page when client navigates to /login or /register
This commit is contained in:
@@ -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();
|
||||
Reference in New Issue
Block a user