1
0
Fork 0
forked from mirror/pixelfed

Update ApiV1DotController, fix inAppRegistrationConfirm logic

This commit is contained in:
Daniel Supernault 2023-01-17 01:47:28 -07:00
parent 8bfdf2c29e
commit 6cfbedd9fd
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -547,13 +547,16 @@ class ApiV1Dot1Controller extends Controller
return response()->json(['error' => 'Invalid tokens'], 403);
}
if($verify->created_at->lt(now()->subHours(24))) {
$verify->delete();
return response()->json(['error' => 'Invalid tokens'], 403);
}
$user = User::findOrFail($verify->user_id);
$user->email_verified_at = now();
$user->last_active_at = now();
$user->save();
$verify->delete();
$token = $user->createToken('Pixelfed');
return response()->json([