Port of Mars is an online, game-based, social science experiment set on the first human community on the Red Planet. We are now in an open beta where anyone aged 18 and over can participate.
Eventually the nuxt app may subsume and contain all of what used to be server and client but this is a long-range task that will require extensive refactoring of all the components etc., to use tailwindcss and nuxt abstractions and simplifications
So as a stopgap measure one direction we're exploring uses JWT tokens based on this SO question:
Eventually the nuxt app may subsume and contain all of what used to be server and client but this is a long-range task that will require extensive refactoring of all the components etc., to use tailwindcss and nuxt abstractions and simplifications
So as a stopgap measure one direction we're exploring uses JWT tokens based on this SO question:
https://stackoverflow.com/questions/73398610/nuxt-3-jwt-authentication-using-fetch-and-pinia
and in particular this question: https://stackoverflow.com/a/73406144/93370
/server/api/login.post.ts
) that creates a fresh JWT based on an email address, e.g.,https://stackoverflow.com/questions/39810741/how-to-store-a-jwt-token-inside-an-http-only-cookie
server/middleware/setAuth.ts
) that makes accessing the authenticated user in all other api endpoints easier:authentication
keyin all nuxt server endpoints that need an auth user get it via
event.context.auth.email
or whatever we set it to in the server/middlewarelegacy server side also needs these same checks, this is probably gonna be ugly copy/paste duplication for simplicity at the moment