update: fix admin editor

This commit is contained in:
tokumeikoi
2021-08-05 14:48:24 +09:00
parent d95974019a
commit 00cd3e26be
8 changed files with 30 additions and 12 deletions

View File

@ -15,8 +15,9 @@ class User
*/
public function handle($request, Closure $next)
{
if ($request->input('auth_data')) {
$authData = explode(':', base64_decode($request->input('auth_data')));
$authorization = $request->input('auth_data') ?? $request->header('authorization');
if ($authorization) {
$authData = explode(':', base64_decode($authorization));
if (!isset($authData[1]) || !isset($authData[0])) abort(403, '鉴权失败,请重新登入');
$user = \App\Models\User::where('password', $authData[1])
->where('email', $authData[0])