mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13: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);
|
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 = User::findOrFail($verify->user_id);
|
||||||
$user->email_verified_at = now();
|
$user->email_verified_at = now();
|
||||||
$user->last_active_at = now();
|
$user->last_active_at = now();
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
$verify->delete();
|
|
||||||
|
|
||||||
$token = $user->createToken('Pixelfed');
|
$token = $user->createToken('Pixelfed');
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
|
|
Loading…
Reference in a new issue