Skip to content
This repository has been archived by the owner on Nov 16, 2018. It is now read-only.

Drupal's 403 responses now contain the reason for denying access — expose that! #53

Closed
wimleers opened this issue Feb 10, 2017 · 4 comments
Assignees

Comments

@wimleers
Copy link
Member

Title says it all :)

See https://www.drupal.org/node/2808233.

Definitely works for rest in Drupal 8.3 core. Should also work for the jsonapi contrib module for sites using Drupal 8.3.

@mattgrill
Copy link

@wimleers This is a great DX improvement. There's an issue with JSON API currently nullifying these error messages, #2852691. However if you don't have JSON API enabled the messages come back already. 😄

waterwheel.populateResources('/water-wheel/swagger/entities?_format=json')
  .then(() => waterwheel.getAvailableResources())
  .then(() => waterwheel.api['node:article'].get(251))
  .then(console.log)
  .catch(err => {
    /*
      {
        message: 'The used authentication method is not allowed on this route.',
        status: 403
      }
    */
  });

@mattgrill mattgrill self-assigned this Feb 16, 2017
@wimleers
Copy link
Member Author

https://www.drupal.org/node/2852691 was fixed a few weeks ago :)

@mattgrill
Copy link

@wimleers Great. I can test this again. I suspect that it will behave correctly already :)

@mattgrill
Copy link

Alright. This should have been closed a while ago. Waterwheel will automatically capture the error message from Drupal and forward on the result.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants