Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Response class not working in SPA
  • Dear.


    I am working with single page application. Here I have backends controller was extended from a single backends controller... I have put some login check in backends controller..

    What I want is... If Auth::check return false... I need the fuel do response 401.  And stop execution of further.. I put the login check in before() of backends controller.

    When ever I access the URL without logged in.. I get 200.

    What is issue...I need 401 if I am not a logged in user. 
  • You can't send a 401 back, unless you use basic or digest authentication, and you also send WWW-Authenticate headers back causing the browser to prompt for authentication.

    Is that what you want?

    If not, do you just want to set a status, of do you want to return some sort of no-access page as well?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion