public function before()This works as expected when POSTing to or GETting from the controller when the user is not logged in. However, when I PUT to the controller (when the user is not logged in), I'm getting a 405 Method Not Allowed response. Am I doing something wrong here?
{
parent::before();
// Make sure the user is authenticated.
if (!\Auth::check()
and \Request::active()->route->segments[1] != 'login'
and \Request::active()->action != 'unauthorized'
and \Request::active()->action != 'logout'
)
{
\Response::redirect('api/login/unauthorized');
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!