mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update ApiV1DotController, fix inAppRegistrationConfirm logic
This commit is contained in:
parent
8bfdf2c29e
commit
6cfbedd9fd
1 changed files with 5 additions and 2 deletions
|
@ -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([
|
||||
|
|
Loading…
Reference in a new issue