Comments (7)
Please also expose options to set "TOKEN_KEY" name, one might not want to use "strapi_jwt"
from strapi.
I am very new to this so I might be wrong but I think you have to set your security settings for headers at server side.
They are are off by default.
https://strapi.io/documentation/v3.x/concepts/middlewares.html#configuration-and-activation.
Then nuxt/strapi module will follow the API rules.
from strapi.
I think we will need to expose the cookie options in the config so they can be given here: https://github.com/nuxt-community/strapi-module/blob/c88ff781dc44ecbaa58ca1c1e63b770662b91669/lib/plugin.js#L166
from strapi.
Hello, two months later and I still can't get this to work. I've tried adding cors and sessions middleware options to Strapi's /config/middleware.js, tried installing the @nuxtjs/proxy module — none of the above stop my cookie from being out-of-date the moment it's set.
Is it Strapi or Nuxt's Strapi module that sets the cookie? Might setting Samesite to Lax be a solution? How to do that?
from strapi.
@atle-granlund, thanks for the suggestion. In Strapi I set config/middleware.js to:
module.exports = {
settings: {
cors: {
enabled: false
},
session: {
enabled: true
},
}
};
But this did not help. As soon as I refresh my console tells me:
Cookie “strapi_jwt” has been rejected because it is already expired.
from strapi.
I only have this problem when Nuxt is running in Production mode — Development mode handles cookies for Strapi just fine,
from strapi.
Turns out the problem was using nuxt-fontawesome instead of @nuxtjs/fontawesome! I've no idea why but making this change solved the issue, at least for me.
from strapi.
Related Issues (20)
- How can i use this under server folder ? HOT 1
- How connect Strapi and Nuxt on Remote server
- Nuxt 3 Cookie Disappears on page reload HOT 2
- Where is the 'admin' module option? HOT 1
- Can I customize the Strapi url for only the data requests, yet keep the defaults on everything else?
- Server side request is returning 403
- Generating static output gives localhost adress
- Export types HOT 10
- How to perform transactions in nuxt HOT 1
- How to handle errors when using useAsyncData?
- Problem with useAsyncData when use NuxtLInk
- SSR for user page using useAsyncData & useStrapiAuth (or useStrapiUser)
- How delete with proxy?
- Typescript on pagination.
- Problem with fetch data in production HOT 1
- Strapi v5 Beta
- Looking for maintainers HOT 1
- Mocking strapi with MSW
- Typing response from find HOT 1
- Strapi impersonation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strapi.