| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | protected function handleUnauthorizedRequest($request) |
||
| 23 | { |
||
| 24 | if ($request->ajax()) { |
||
| 25 | return response('Unauthorized.', 401); |
||
| 26 | } |
||
| 27 | |||
| 28 | if (app(Section::class)->isFront()) { |
||
| 29 | return redirect()->guest(action('Front\AuthController@getLogin')); |
||
| 30 | } |
||
| 31 | |||
| 32 | if (app(Section::class)->isBack()) { |
||
| 33 | return redirect()->guest(action('Back\AuthController@getLogin')); |
||
| 34 | } |
||
| 35 | |||
| 36 | throw new Exception('Invalid auth guard specified'); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |