diff --git a/app/plugins/auth.ts b/app/plugins/auth.ts index 2b0bb34..8cdc24a 100644 --- a/app/plugins/auth.ts +++ b/app/plugins/auth.ts @@ -6,15 +6,8 @@ export default defineNuxtPlugin(async () => { try { const res = await useAsyncData('oauth-sess-fetch', () => requestFetch('/api/userinfo')); const fetchedSession = res.data.value; - if (!fetchedSession) { - throw new Error('Empty session received'); - } - session.value = fetchedSession; + session.value = fetchedSession as Session; // it's ok if data not present. } catch (e) { - console.error('Error fetching user.', e); - throw createError({ - statusCode: 500, - statusMessage: 'Unable to setup session. Try again later', - }); + console.error('Error while fetching session', e); } });