6

I want to disable the front-end access of my headless Drupal site, that is just a REST API for a Vue site.

Except for the login page, there is no need to access any node, taxonomy or view directly as everything is delivered via REST.

How can I achieve this?

  • 1
    I suppose two ways to do it would be add Rabbit Hole module or disable "access content" permission from anonymous users. If you are using ACL on a headless site, the latter may be problematic. – Kevin Oct 26 '18 at 21:18
  • 1
    So basically you want a redirect from everywhere to /user, no? – leymannx Oct 27 '18 at 18:20
  • 3
    nope... just for not logged in users. Logged in users should be able to access the backend (Admin Interface). Is there no workflow to follow? I don't think I am the first person that uses Drupal in an headless manor. Really the question is... how to decouple Drupal from it's frontend (not drupal admin) as alle the nodes, taxonomies and views are served via rest. – mogio Oct 27 '18 at 21:26
  • 1
    Did you find a solution to that? I am trying to achieve exactly the same... – MrUpsidown Dec 5 '18 at 15:32
  • 1
    I think it will take a direction similar to Kevins solution. I was not able to find any best practice nor guide. – mogio Dec 12 '18 at 7:02
0

Based on your responses in the comments, it sounds like you want anonymous users to be sent to the login page on any access and for authenticated users to be able to access the site as normal. You can achieve this with a custom module that checks for logged-in status and redirect to the login page, or via the Require Login Module which does essentially the same thing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.