2025-06-30 18:58:24 +02:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: © 2025 Hornwitser <code@hornwitser.no>
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
-->
|
2025-03-09 22:21:13 +01:00
|
|
|
<template>
|
2025-07-08 15:51:50 +02:00
|
|
|
<template v-if='data?.data?.code === "SESSION_TAKEN"'>
|
|
|
|
<h1>Session taken</h1>
|
|
|
|
<p>
|
|
|
|
Your session with the server has been taken over by another browser, device, or HTTP agent. This could happen due to one of the following reasons:
|
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
The session cookie on this device got restored to an earlier state for example as a result of a restore or a crash.
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
The server issued a new session to the client but the client didn't get the repsonse.
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
The session cookie was copied and used on another device, browser or HTTP agent.
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p>
|
|
|
|
It's possible however unlikely that someone else have hijacked your session.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
@click="abandonSession"
|
|
|
|
>
|
|
|
|
Abandon Session
|
|
|
|
</button>
|
|
|
|
</p>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
<Header />
|
|
|
|
<h1>{{ error.statusCode }} {{ error.statusMessage }}</h1>
|
|
|
|
<p v-if="error.message !== error.statusMessage">
|
|
|
|
{{ error.message }}
|
|
|
|
</p>
|
|
|
|
<pre v-if="error.stack"><code>{{ error.stack }}</code></pre>
|
|
|
|
</template>
|
2025-03-09 22:21:13 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2025-07-08 15:51:50 +02:00
|
|
|
const props = defineProps<{ error: {
|
2025-03-09 22:21:13 +01:00
|
|
|
statusCode: number,
|
|
|
|
fatal: boolean,
|
|
|
|
unhandled: boolean,
|
|
|
|
statusMessage?: string,
|
2025-07-08 15:51:50 +02:00
|
|
|
data?: string,
|
2025-03-09 22:21:13 +01:00
|
|
|
cause?: unknown,
|
|
|
|
|
|
|
|
// Undocumented fields
|
|
|
|
url?: string,
|
|
|
|
message?: string,
|
|
|
|
stack?: string,
|
2025-07-08 15:51:50 +02:00
|
|
|
}}>();
|
|
|
|
const data = computed<{
|
|
|
|
data?: {
|
|
|
|
code?: string,
|
|
|
|
},
|
|
|
|
}>(() => props.error.data ? JSON.parse(props.error.data) : undefined);
|
|
|
|
async function abandonSession() {
|
|
|
|
await $fetch("/api/auth/session", { method: "DELETE", }).catch(err => alert(err.message));
|
|
|
|
await navigateTo("/");
|
|
|
|
}
|
2025-03-09 22:21:13 +01:00
|
|
|
</script>
|