Simple authentication example with a session cookie using next-session
tinyhttp new sessionnode index.jsAnd in another terminal:
- To login
curl -d "user=admin&pwd=admin" -v http://localhost:3000/loginFrom the response of the above command, note the value of the sid cookie value
- To verify session (replace the cookie value obtained from the above output)
curl -H 'Cookie: micro.sid=COOKIE_VALUE_HERE' http://localhost:3000/admin