Studio now requires a server-side route for authentication
Hello there!
I'm trying to play a little bit with Studio to see if it can be used to fulfilled some internal projects.
The current doc is saying in the "what changes" section:
The only trade-off is that Studio now requires a server-side route for authentication. While static generation remains supported with Nuxt hybrid rendering, your site must be deployed on a platform that supports SSR.
Ok, that's fine. But so.. What? Where should it be added? What should it contains? I cannot find any example nor specification for the time being.
As someone already used the alpha version?
2 Replies
Hi @kogratte. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The knowledge sources you provided don’t contain any concrete example or specification of the “server-side route for authentication” that Nuxt Studio now requires, nor a snippet of what such a route should look like.
What is covered in the docs and PRs we have is:
- Nuxt’s
server/api directory is the place to define server routes and APIs that run on the Nitro server (SSR), typically used for things like authentication and sessions.[Is it required to use server folder; api functionality docs]
- There is an official “session and authentication” recipe using nuxt-auth-utils that shows how to manage user sessions on the server side (login/logout, checking user, etc.).[session and authentication]
- There’s also documentation and examples around handling auth tokens with cookies on the server, e.g. via useCookie in API routes or plugins, which is the usual pattern for Nuxt-side auth.[handling authentication with useCookie]
However, none of these sources explicitly tie a specific route shape or contract to Nuxt Studio itself, and they don’t show the exact API that Studio expects (e.g. a required path like /api/_studio/auth, required payload, etc.). Because of that, I can’t reliably tell you:
- the exact URL path Studio will call
- the expected request/response format
- whether it must be in server/api or can be any Nitro route
- any special headers or tokens Studio requires
Given the lack of explicit information in the provided sources, the best I can say based on them is:
- You will need at least one server route (most likely in server/api) that implements your authentication logic (login / session check / logout) and is accessible from Studio when you open your project.[Is it required to use server folder; api functionality docs]
- That route will run on the SSR platform where your Nuxt app is deployed (Vercel, Netlify functions, Node server, etc.), not on a purely static host.
- You can base its implementation on the session/auth recipe or the useCookie-based auth examples from the Nuxt docs, but you’ll still need the Studio‑specific details from the official Studio docs or example repo.[session and authentication; handling authentication with useCookie]
Because the knowledge sources don’t include the Studio module’s own documentation or an example Studio auth route, I’m sorry, but there’s no information here about the precise route and contract Studio expects. You’ll need to check the current Nuxt Studio docs or example projects referenced in the Studio announcement, or any sample repo linked from that blog post, for the concrete implementation details.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@639111892144619539> Kapa.ai is still learning and improving, please let me know how I did by reacting below.