Spaces:
Running
Running
Okay now add nitro as ssr and add an express backend with a simple login and authentication system that creates session id and stores session id as http only cookie and in the ssr middleware for all routes we do have a check for the http only cookie to check if is present or expired to redirect to home page or to login page
d502d70 verified Invalid JSON: Unexpected token '`', "```json
{
"... is not valid JSON
| ```json | |
| { | |
| "name": "nitro-auth-express", | |
| "version": "1.0.0", | |
| "type": "module", | |
| "scripts": { | |
| "dev": "npx nitropack dev", | |
| "build": "npx nitropack build", | |
| "preview": "node .output/server/index.mjs" | |
| }, | |
| "dependencies": { | |
| "nitropack": "^2.9.0", | |
| "h3": "^1.11.0", | |
| "express-session": "^1.18.0", | |
| "cookie-parser": "^1.4.6" | |
| }, | |
| "devDependencies": { | |
| "@types/express-session": "^1.18.0" | |
| } | |
| } | |
| ``` |