mirror of
https://github.com/gurucomputing/headscale-ui.git
synced 2026-01-23 02:34:43 +00:00
set default to login page
This commit is contained in:
parent
5ea553ffd0
commit
30989d5fce
3 changed files with 30 additions and 12 deletions
|
|
@ -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>
|
||||
|
|
@ -1 +0,0 @@
|
|||
firstregistration
|
||||
|
|
@ -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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue