Return preview users to Studio 2 after login

This commit is contained in:
Towsty
2026-09-10 21:33:41 -05:00
parent fd9522ae19
commit f312cff477
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -39,6 +39,7 @@
<script setup lang="ts">
const config = useRuntimeConfig()
const route = useRoute()
const instanceName = ref(String(config.public.instanceName || 'AIGen'))
const authMode = ref(String(config.public.authMode || ''))
const username = ref('')
@@ -57,7 +58,7 @@ async function submit() {
error.value = ''
try {
await $fetch('/api/auth/login', { method: 'POST', body: { username: username.value, password: password.value } })
await navigateTo('/')
await navigateTo(route.query.next === '/studio-2' ? '/studio-2' : '/')
} catch (err: any) {
error.value = err?.data?.statusMessage || err?.statusMessage || 'Sign in failed'
} finally {