0

csrf token with form param is not working.

params = {
                title: screen.getTitle(),
                windowId: screen.getId(),
                filter: filter,
                sort: sort,
                items: items.toString(),
                _csrf : Manh._csrfConfig.value
            }


form.submit({
                url: url,
                params: params
            });

but with url

url = url + '?windowId=' + screen.getId() + '&_csrf=' + Manh._csrfConfig.value; 

is working. I dont want to send the csrf token with the url. Please suggest.

<oauth>
<error_description>
Invalid CSRF Token 'null' was found on the request parameter '_csrf' or header 'X-CSRF-TOKEN'.
</error_description>
<error>access_denied</error>
</oauth>
Sudhansu Kumar
  • 129
  • 1
  • 3
  • 10

1 Answers1

0

here is working example https://fiddle.sencha.com/#view/editor&fiddle/311c

So basically in your code you would need to add headers to form.submit method

form.submit({
   url: url,
   headers: {
       'X-CSRF-Token': 'Token'    
   },
   params: params //params without token in them
})