set default to login page

This commit is contained in:
Chris 2025-11-15 00:20:45 +00:00
parent 5ea553ffd0
commit 30989d5fce
3 changed files with 30 additions and 12 deletions

View file

@ -15,16 +15,16 @@
}
if(!validLogin) {
// attempt to authenticate with default credentials and redirect to first registration screen
try {
let authData = await appSettings.pb.collection("_superusers").authWithPassword('superadmin@breakglass.local', 'firsttimepasswordchangeme');
if (authData) {
appSettings.pb.authStore.clear();
goto(resolve(`/firstregistration.html`));
}
} catch (error) {
goto(resolve(`/login.html`))
}
goto(resolve(`/login.html`));
}
}
// try {
// let authData = await appSettings.pb.collection("_superusers").authWithPassword('superadmin@breakglass.local', 'firsttimepasswordchangeme');
// if (authData) {
// appSettings.pb.authStore.clear();
// goto(resolve(`/firstregistration.html`));
// }
// } catch (error) {
// goto(resolve(`/login.html`))
// }
</script>

View file

@ -1 +0,0 @@
firstregistration

View file

@ -1 +1,20 @@
login
<script lang="ts">
import { appSettings } from '$lib/components/common/state.svelte';
appSettings.navbarTitle = 'Login';
appSettings.sidebarDrawerOpen = false;
</script>
<div class="flex items-center justify-center">
<fieldset class="fieldset bg-base-200 border-base-300 rounded-box w-xs border p-4">
<legend class="fieldset-legend">Login</legend>
<label class="label" for="email">Email</label>
<input type="email" class="input" id="email" placeholder="Email" />
<label class="label" for="password">Password</label>
<input type="password" class="input" id="password" placeholder="Password" />
<button class="btn btn-neutral mt-4">Login</button>
</fieldset>
</div>