Zerro
Nuxt3: Using node version below 18
Hi community!
Is it possible to use Nuxt 3 with node version below 18?
I'm trying to run nuxt app on older ubuntu version (v18). However, ubuntu does not support node version above 18 due to glibc incompatibility. I could either:
1. Update ubuntu version
2. Update glibc version
3. Try use lower node version for nuxt 3
Unfortunately I cannot update ubuntu version due project requirement. I could update glibc version of Ubuntu but it seems like i might break the OS environment if I'm not careful with the update.
Can nuxt 3 be used with lower node version like version 17? Thank you in advance!
5 replies
How to create custom $fetch for server side only
Hi all!
I'm trying to think of way to create custom $fetch function to include authorization header for JWT token. JWT token is obtained from another backend API that I have.
Currently I'm storing the JWT token in server side of nuxt app and only exposes session id to the client side of nuxt app through cookie. When I'm making a request from server side of nuxt app to my other backend API, I want to include this JWT token that i stored in the session (sqlite db).
I've seen some examples that used nuxt plugin to define custom $fetch during vue app initialization but I wasn't sure how to achieve this only for server side $fetch (it has to be server side because that's where i store the jwt token).
3 replies
Best practice for storing JWT token
Hi all!
Currently I'm developing an internal organization nuxt 3 web app that is not exposed to internet. I have backend api implemented in golang and another mobile app that is exposed to internet. (ie. 1 web app (private), 1 backend api (public), 1 mobile app (public))
Originally, backend api sent the jwt (access/refresh token) in response body to mobile app but now that I'm adding web app, I wasn't sure if I should use session cookie to store the JWT instead of including the token in response body.
How do you usually store token in browser? Given that this is internal organization web app, will it be alright to store the token in local/session storage? What kind of risks do i have for storing it in local/session storage for private web app?
Also, I wasn't sure if I wanted to use other nuxt 3 modules like sidebase auth. I took a look at an example from sidebase it seemed like it was implementing auth logic in server side of nuxt app instead of using custom backend api solution (like golang for my case). I mainly wanted to use auth library because I wasn't sure if my own implementation would be secure enough.
So tldr:
1. Is it secure to store jwt in local/session storage (for private app not exposed to internet)
2. Any recommendation for auth library for custom backend api
3. Advice on best practices for authentication using JWT (not oauth) for SSR application
8 replies
Delay in NuxtLayout Change
I have noticed that when using
<NuxtLayout>
in individual pages (each of pages in /pages
directory), there is delay in transition between different layouts.
When defining <NuxtLayout>
in app.vue
, however, I didn't notice such delay during transition.
Is there any way to fix this delay during layout change? I can't afford to put <NuxtLayout>
in app.vue
because it causes a problem when using layout binding in nuxt content module.2 replies