develop
Last change
on this file since e651d0d was 7304c7f, checked in by beratkjufliju <kufliju@…>, 3 years ago |
added user authentication, create & forgot password methods and blades
|
-
Property mode
set to
100644
|
File size:
579 bytes
|
Rev | Line | |
---|
[7304c7f] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | namespace App\Http\Middleware;
|
---|
| 4 |
|
---|
| 5 | use Closure;
|
---|
| 6 | use App\Models\User;
|
---|
| 7 |
|
---|
| 8 | class CheckVerifyNewEmail
|
---|
| 9 | {
|
---|
| 10 | /**
|
---|
| 11 | * Handle an incoming request.
|
---|
| 12 | *
|
---|
| 13 | * @param \Illuminate\Http\Request $request
|
---|
| 14 | * @param \Closure $next
|
---|
| 15 | * @return mixed
|
---|
| 16 | */
|
---|
| 17 | public function handle($request, Closure $next)
|
---|
| 18 | {
|
---|
| 19 | $id = $request->route("id");
|
---|
| 20 | $token = $request->route("token");
|
---|
| 21 |
|
---|
| 22 | $user = User::findOrFail($id);
|
---|
| 23 |
|
---|
| 24 | if($user->is_active) {
|
---|
| 25 | return redirect()->route("auth.loginShow");
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | return $next($request);
|
---|
| 29 | }
|
---|
| 30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.