This route can only be accessed by authenticated users.

Created on 20 December 2023, 11 months ago
Updated 21 December 2023, 11 months ago

After installing the module, I followed the link /jsonapi/site/site and received the error 403 "its route can only be accessed by authenticated users." I have attached a screenshot of the json response

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @l1fesxff
  • The problem is that jsonapi_site.routing.yml has requirements : _user_is_logged_in: 'TRUE' , which blocks an anonymous user. I tried to remove this option and replace it with _permission: 'access content', but it did not solve the problem. Please update

  • 🇷🇺Russia Andrew Answer Novosibirsk

    Hello l1fesxff,

    yes, this module does not allow to read route by anonymous users. You need to use Key Auth module to create API key and then use it in the query/header for route authentication. The reason of this is because of this module usually used on the "decoupled" Drupal sites i.e where frontend is an isolated application (written on Vue, React or some other frontend frameworks), and Drupal as the backend.

  • Status changed to Closed: works as designed 11 months ago
Production build 0.71.5 2024