mirror of
https://github.com/zoe-may/TDoG-Skin.git
synced 2025-01-19 07:07:24 +08:00
20 lines
424 B
PHP
Executable File
20 lines
424 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Closure;
|
|
|
|
class EnsureEmailFilled
|
|
{
|
|
public function handle($request, Closure $next)
|
|
{
|
|
if ($request->user()->email != '' && $request->is('auth/bind')) {
|
|
return redirect('/user');
|
|
} elseif ($request->user()->email == '' && !$request->is('auth/bind')) {
|
|
return redirect('/auth/bind');
|
|
}
|
|
|
|
return $next($request);
|
|
}
|
|
}
|