Fix login not redirecting

This commit is contained in:
Mawoka
2025-10-26 13:23:19 +01:00
parent 96c4a59fb9
commit 32f560c57a
5 changed files with 45 additions and 18 deletions
@@ -99,27 +99,27 @@ SPDX-License-Identifier: MPL-2.0
{:else if selected_method === null}
<!-- <p>SelectWindow</p>-->
<div transition:slide|global>
<SelectMethod bind:session_data bind:step bind:selected_method />
<SelectMethod {session_data} {step} bind:selected_method />
</div>
{:else if selected_method === 'PASSWORD'}
<!-- <p>PasswordWindow</p>-->
<div transition:slide|global>
<PasswordComponent bind:session_data bind:done bind:step bind:selected_method />
<PasswordComponent {session_data} bind:done bind:step bind:selected_method />
</div>
{:else if selected_method === 'PASSKEY'}
<!-- <p>WebauthnWindow</p>-->
<div transition:slide|global>
<WebauthnComponent bind:session_data bind:done bind:step bind:selected_method />
<WebauthnComponent {session_data} bind:done bind:step bind:selected_method />
</div>
{:else if selected_method === 'BACKUP'}
<!-- <p>BackupWindow</p>-->
<div transition:slide|global>
<BackupComponent bind:session_data bind:done bind:step bind:selected_method />
<BackupComponent {session_data} bind:done bind:step bind:selected_method />
</div>
{:else if selected_method === 'TOTP'}
<!-- <p>TotpWindow</p>-->
<div transition:slide|global>
<TotpComponent bind:session_data bind:done bind:step bind:selected_method />
<TotpComponent {session_data} bind:done bind:step bind:selected_method />
</div>
{/if}
</div>
@@ -6,19 +6,14 @@ SPDX-License-Identifier: MPL-2.0
<script lang="ts">
let { session_data = {}, step, selected_method = $bindable() } = $props();
let available_methods = $state();
const set_available_methods = (step_var: number) => {
const set_available_methods = (step_var: number): string => {
if (step_var === 1) {
available_methods = session_data.step_1;
return session_data.step_1;
} else if (step_var === 2) {
available_methods = session_data.step_2;
return session_data.step_2;
}
};
$effect.pre(() => {
set_available_methods(step);
});
let available_methods = $derived(set_available_methods(step));
</script>
<div class="px-6 py-4">