Skip to content

Commit 97c9220

Browse files
committed
Check for route protection when set on the route or route group.
Signed-off-by: Jason Lewis <[email protected]>
1 parent 4149c4e commit 97c9220

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Routing/Route.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ public function getMiddleware()
356356
*/
357357
public function isProtected()
358358
{
359-
if (isset($this->middleware['api.auth'])) {
360-
if ($this->controller) {
359+
if (isset($this->middleware['api.auth']) || in_array('api.auth', $this->middleware)) {
360+
if ($this->controller && isset($this->middleware['api.auth'])) {
361361
return $this->optionsApplyToControllerMethod($this->middleware['api.auth']);
362362
}
363363

0 commit comments

Comments
 (0)