Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions frontend/js/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

document.addEventListener('DOMContentLoaded', () => {
// Already logged in? skip auth pages.
if (SS.isAuthed() && (location.pathname.includes('login') || location.pathname.includes('signup'))) {
window.location.href = '/dashboard';
if (SS.isAuthed() && (location.pathname.includes('login.html') || location.pathname.includes('signup.html'))) {
window.location.href = '/dashboard.html';
return;
}

Expand Down Expand Up @@ -35,7 +35,7 @@ async function handleGuest(e) {
SS.setSession(data.token, data.user);
sessionStorage.setItem('ss_show_welcome', 'true');
SS.toast('Exploring as guest. Sign up anytime to save your work!');
setTimeout(() => (window.location.href = '/dashboard'), 500);
setTimeout(() => (window.location.href = '/dashboard.html'), 500);
} catch (err) {
msg(err.message);
busy(btn, false);
Expand Down Expand Up @@ -110,7 +110,7 @@ async function handleLogin(e) {
SS.setSession(data.token, data.user);
sessionStorage.setItem('ss_show_welcome', 'true');
SS.toast('Welcome back, ' + data.user.name + '!');
setTimeout(() => (window.location.href = '/dashboard'), 500);
setTimeout(() => (window.location.href = '/dashboard.html'), 500);
} catch (err) {
msg(err.message);
busy(btn, false);
Expand All @@ -137,7 +137,7 @@ async function handleSignup(e) {
SS.setSession(data.token, data.user);
sessionStorage.setItem('ss_show_welcome', 'true');
SS.toast('Account created! Welcome, ' + data.user.name + '.');
setTimeout(() => (window.location.href = '/dashboard'), 600);
setTimeout(() => (window.location.href = '/dashboard.html'), 600);
} catch (err) {
msg(err.message);
busy(btn, false);
Expand Down Expand Up @@ -181,7 +181,7 @@ async function handleReset(e) {
try {
const data = await SS.api('/api/auth/reset-password', { method: 'POST', auth: false, body: { token, password } });
msg(data.message + ' Redirecting to login…', 'success');
setTimeout(() => (window.location.href = '/login'), 1500);
setTimeout(() => (window.location.href = '/login.html'), 1500);
} catch (err) {
msg(err.message);
busy(btn, false);
Expand Down