Code Duplication    Length = 5-7 lines in 2 locations

src/Exception/ExceptionHandler.php 2 locations

@@ 51-57 (lines=7) @@
48
         *
49
         * @todo: Clean up
50
         */
51
        if ($e instanceof AuthenticationException) {
52
            if ($request->segment(1) === 'admin') {
53
                return redirect()->guest('admin/login');
54
            } else {
55
                return redirect()->guest('login');
56
            }
57
        }
58
59
        if ($e instanceof HttpException) {
60
            if (!$e->getStatusCode() == 404) {
@@ 146-150 (lines=5) @@
143
            return response()->json(['error' => 'Unauthenticated.'], 401);
144
        }
145
146
        if ($request->segment(1) === 'admin') {
147
            return redirect()->guest('admin/login');
148
        } else {
149
            return redirect()->guest('login');
150
        }
151
    }
152
}
153