helpers for using cookies with township
If your use case requires you to store the JWTs that township creates in cookies rather than localstorage or similar, this module can help.
npm install --save township-cookie
var townshipCookie = require('township-cookie')
var cookies = townshipCookie({
name: 'example',
hostname: 'example.com'
})
// set a cookie with a JWT token on a response object
cookies.set(res, token)
// get a token from a cookie on a request object
var token = cookies.get(req)
// remove a cookie from a response object
cookies.remove(req)
Contributions are welcome! Please read the contributing guidelines first.
It's important that this project contributes to a friendly, safe, and welcoming environment for all, particularly for folks that are historically underrepresented in technology. Read this project's code of conduct