Ошибка унавторайзед, если в режиме инкогнито (без кук)

This commit is contained in:
Alexander Andreev 2026-01-09 14:51:56 +03:00
parent 72f69ad14d
commit 45fc71f8bd
12 changed files with 21 additions and 1 deletions

View File

@ -108,12 +108,32 @@
</template>
<script setup lang="ts">
import { ref, reactive, watch, computed } from 'vue';
import { ref, reactive, watch, computed, onMounted } from 'vue';
// --- Composables ---
const api = useApi();
const { user, updateUser, register } = useAuth();
// --- Onboardning initiation ---
onMounted(async () => {
if (user.value) {
return;
}
try {
isLoading.value = true;
const anonymousUser = await api('/api/onboarding/initiate', { method: 'POST' });
if (anonymousUser) {
updateUser(anonymousUser);
}
} catch (e: any) {
error.value = 'Не удалось начать сессию. Попробуйте обновить страницу';
} finally {
isLoading.value = false;
}
});
// --- Economy Constants ---
const { data: economy, pending: economyPending } = useAsyncData('economy-constants', () =>
$fetch('/api/economy/constants')

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB