Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com>
Co-authored-by: Aditya Tripathi <aditya@climactic.co>
This commit is contained in:
Andras Bacsai
2026-11-06 14:25:02 +01:00
committed by GitHub
co-authored by Claude Opus 5.5 peaklabs-dev Aditya Tripathi
parent b7dc2e435b
commit 033f0c84da
581 changed files with 58626 additions and 2456 deletions
+16 -1
View File
@@ -139,7 +139,12 @@ class Controller extends BaseController
$user->forceFill([
'password' => Hash::make(Str::random(64)),
])->save();
]);
// Only an emailed token proves the address. A copied link can be used by the inviting admin.
if ($invitation->via === 'email' && ! $user->hasVerifiedEmail()) {
$user->forceFill(['email_verified_at' => now()]);
}
$user->save();
$invitation->delete();
return [$user, $team, $invitation, $alreadyMember];
@@ -224,6 +229,11 @@ class Controller extends BaseController
abort(400, 'You are not allowed to accept this invitation.');
}
// A magic link session accepts only the invitation of its own link, until the user sets a password.
if ($user->force_password_reset) {
abort(400, 'Set your password before you accept another invitation.');
}
if (! $invitation->isValid()) {
abort(400, 'Invitation expired.');
}
@@ -249,6 +259,11 @@ class Controller extends BaseController
abort(400, 'You are not allowed to accept this invitation.');
}
// A magic link session accepts only the invitation of its own link, until the user sets a password.
if ($user->force_password_reset) {
abort(400, 'Set your password before you accept another invitation.');
}
if (! $invitation->isValid()) {
abort(400, 'Invitation expired.');
}