feat: harden identity and recovery operations
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Settings;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Settings\PasswordUpdateRequest;
|
||||
use App\Http\Requests\Settings\TwoFactorAuthenticationRequest;
|
||||
use App\Integrations\Microsoft\MicrosoftOidcClient;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Validation\Rules\Password;
|
||||
use Inertia\Inertia;
|
||||
@@ -16,8 +17,12 @@ class SecurityController extends Controller
|
||||
/**
|
||||
* Show the user's security settings page.
|
||||
*/
|
||||
public function edit(TwoFactorAuthenticationRequest $request): Response
|
||||
public function edit(TwoFactorAuthenticationRequest $request, MicrosoftOidcClient $microsoft): Response
|
||||
{
|
||||
$microsoftIdentity = $request->user()
|
||||
->externalIdentities()
|
||||
->where('provider', 'microsoft')
|
||||
->first();
|
||||
$props = [
|
||||
'canManageTwoFactor' => Features::canManageTwoFactorAuthentication(),
|
||||
'canManagePasskeys' => Features::canManagePasskeys(),
|
||||
@@ -38,6 +43,12 @@ class SecurityController extends Controller
|
||||
->all()
|
||||
: [],
|
||||
'passwordRules' => Password::defaults()->toPasswordRulesString(),
|
||||
'microsoft' => [
|
||||
'enabled' => $microsoft->configured(),
|
||||
'linked' => $microsoftIdentity !== null,
|
||||
'email' => $microsoftIdentity?->provider_email,
|
||||
'lastLoginAt' => $microsoftIdentity?->last_login_at?->toIso8601String(),
|
||||
],
|
||||
];
|
||||
|
||||
if (Features::canManageTwoFactorAuthentication()) {
|
||||
|
||||
Reference in New Issue
Block a user