feat: complete onboarding flow

This commit is contained in:
Zoe
2026-10-08 14:04:29 -05:00
parent fae05ebc4c
commit 61f9bb74b4
16 changed files with 684 additions and 297 deletions
+8 -3
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { deriveKey } from '~/utils/crypto';
const { signIn } = useAuth();
const { signIn, fetchSession } = useAuth();
definePageMeta({
layout: 'auth',
@@ -127,8 +127,11 @@ const submit = async () => {
const key = await deriveKey(form.password, res.data.user.id);
localStorage.setItem('encryptionKey', JSON.stringify(key));
// straight on to connecting a provider, the instance is useless without one
return navigateTo('/welcome');
// the next steps are for admins only, so make sure the role is loaded
await fetchSession();
// on to the rest of the setup: who can register, then a first provider
return navigateTo('/setup/instance');
};
</script>
@@ -160,6 +163,8 @@ const submit = async () => {
</div>
<template v-else>
<OnboardingSetupSteps :current="1"></OnboardingSetupSteps>
<p
class="px-3 py-2.5 rounded-lg bg-[var(--bg-container)] border border-[var(--color-border)] text-sm leading-snug text-[var(--text-secondary)]">
No accounts exist yet. The account you create here becomes the