diff --git a/app/pages/login.vue b/app/pages/login.vue new file mode 100644 index 0000000..ecc1674 --- /dev/null +++ b/app/pages/login.vue @@ -0,0 +1,28 @@ + diff --git a/app/pages/logout.vue b/app/pages/logout.vue index 31b28bd..99061d4 100644 --- a/app/pages/logout.vue +++ b/app/pages/logout.vue @@ -21,6 +21,7 @@ import { useAuthStore } from '~/stores/auth' const router = useRouter() const auth = useAuthStore() +const config = useRuntimeConfig() useHead({ title: 'Logout – OpenSquawk', @@ -31,7 +32,17 @@ useHead({ onMounted(async () => { await auth.logout() - router.replace('/login') + + // Sign out at the issuer too. Sending the user to the app's own /login would + // only forward them back to an issuer where they are still signed in — they + // would be handed a fresh code and land straight back inside, which is not + // what "log out" means. + const issuer = String(config.public.authIssuer || '').replace(/\/+$/, '') + if (issuer) { + return navigateTo(`${issuer}/logout`, { external: true }) + } + + router.replace('/') })