fix: expired invites

This commit is contained in:
HDVinnie
2023-06-02 22:56:14 -04:00
parent f007edcdf1
commit cca60021cd
3 changed files with 7 additions and 1 deletions
@@ -153,6 +153,11 @@ class InviteController extends Controller
->withErrors(trans('user.invite-already-used'));
}
if ($invite->expires_on < now()) {
return to_route('invites.index', ['username' => $user->username])
->withErrors(trans('user.invite-expired'));
}
Mail::to($invite->email)->send(new InviteUser($invite));
return to_route('invites.index', ['username' => $user->username])