mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
v4.7 (#12478)
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:
co-authored by
Claude Opus 5.5
peaklabs-dev
Aditya Tripathi
parent
b7dc2e435b
commit
033f0c84da
@@ -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.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user