1 | <?php |
||
17 | class OtpAccess |
||
18 | { |
||
19 | /** |
||
20 | * Handle an incoming request. |
||
21 | * |
||
22 | * @param \Illuminate\Http\Request $request |
||
23 | * @param \Closure $next |
||
24 | * @param null|string $guard |
||
25 | * |
||
26 | * @return mixed |
||
27 | */ |
||
28 | public function handle($request, Closure $next, $guard = null) |
||
59 | |||
60 | /** |
||
61 | * Get the redirect url if check do not pass. |
||
62 | * |
||
63 | * @return RedirectResponse |
||
64 | */ |
||
65 | protected function redirectToOtpPage(): RedirectResponse |
||
74 | |||
75 | /** |
||
76 | * Get the guard by the given name. |
||
77 | * |
||
78 | * @param string $guard |
||
79 | * |
||
80 | * @return Guard |
||
81 | */ |
||
82 | private function getGuard($guard): Guard |
||
86 | |||
87 | /** |
||
88 | * Get the authenticated user from |
||
89 | * the guard by the given name. |
||
90 | * |
||
91 | * @param string $guard |
||
92 | * |
||
93 | * @return null|Authenticatable |
||
94 | */ |
||
95 | private function getAuthUser($guard): ?Authenticatable |
||
99 | |||
100 | /** |
||
101 | * Create a new otp and notify the user. |
||
102 | * |
||
103 | * @param Authenticatable $user |
||
104 | */ |
||
105 | private function sendNewOtpToUser(Authenticatable $user): void |
||
111 | } |
||
112 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.