https://github.com/simov/grant-session
https://github.com/simov/grant-session
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/simov/grant-session
- Owner: simov
- License: mit
- Created: 2020-06-22T13:24:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-04T12:19:14.000Z (over 5 years ago)
- Last Synced: 2025-05-15T02:13:49.972Z (8 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# grant-session
> _Session handler for Grant_
```js
{
handler: 'aws', // required
name: 'grant',
secret: '...', // required
cookie: {path: '/', httpOnly: true, secure: false, maxAge: null},
embed: false,
store: {
get: async (key) => {},
set: async (key, value) => {},
remove: async (key) => {},
}
}
```
- `handler` - Grant handler name, either `node`, `aws` or `vercel` **required**
- `name` - the name of the session cookie, defaults to `grant`
- `secret` - used to sign the cookie **required**
- `cookie` - [cookie] options, defaults to `{path: '/', httpOnly: true, secure: false, maxAge: null}`
- `embed` - embed the session data into the cookie, possible value: `true`
- `store` - external session store implementation, `embed` have to be falsy and the store methods have to be implemented
Either `embed` have to be `true` or the `store` have to be implemented!
[cookie]: https://www.npmjs.com/package/cookie