How to set CSRF token for post request in Framework7Vue app


#1

I want to make request from app to laravel, and it asks for me csrf token . is there any idea to authenticate from laravel to framework7vue app with token(csrf) or need to authenticate with JWT?


#2

Simple, use headers… Normal ajax

app.request({
  url: '...your laravel url',
  data: {},
 headers: {
  Authorization: 'Bearer something',
  //or
  'csrf': 'some-token'
}
});

make sure your server is configured to read csrf or auth headers otherwise CORS will fail you… As for your server side code, you will google how…:grin: