Releases: nuxt-modules/strapi
v1.0.0
What's Changed
- feat: migrate module to nuxt3 + support strapi v4 by @benjamincanac in #183
- feat: module improvements by @pi0 in #188
Old documentation for nuxt 2 module available at https://strapi-v0.nuxtjs.org/
Full Changelog: v0.3.4...v1.0.0
v0.3.1
v0.3.0
TypeScript
The module has been rewritten with TypeScript and using Siroc as bundler.
Session options
This PR also add a properties into the module to configure the session:
export default {
strapi: {
key: 'strapi_jwt',
expires: 'session',
cookie: {}
}
}
key
- Type:
String
- Default:
'strapi_jwt'
Key used for the cookie name as well as LocalStorage/SessionStorage key.
expires
- Type:
String
orNumber
or'session'
- Default: 'session'
When expires === 'session'
, the sessionStorage will be used to act like the cookie.
Otherwise, the value is a string, it will be parsed using ms, ex: expires: '7d'
A number can also be provided as milliseconds, ex: expires: 7 * 24 * 3600 * 1000
It would be possible also to configure during runtime the expiration, example:
if (form.rememberMe) {
this.$strapi.options.expires = 31 * 24 * 3600 * 1000; // Only number is possible
}
await this.$strapi.login({ identifier: '...', password: '...' })
cookie
- Type:
Object
- Default:
{}
Options to forward to the cookie#options module, the expires
property will be overwritten.
Resolved #70
Misc
- The error returned by
$strapi
also include.original
to list the error code, resolves #89
Learn more at https://strapi.nuxtjs.org