fix(iam): align cross-app proofs and add native IAM target launch

This commit is contained in:
2026-10-29 18:49:32 +08:00
parent dcb0db8275
commit 7cbc679287
25 changed files with 837 additions and 99 deletions
@@ -79,9 +79,12 @@ final class IamLoginService
$transaction = $this->transactions->consume('ticket', $ticket, $browser);
// Recheck entitlement, binding and local status immediately before issuing the existing business token.
$admin = $this->verifiedAdmin($transaction['subject']);
$result = (array) (new LoginLogic())->login(['account' => $admin->account, 'terminal' => AdminTerminalEnum::PC]);
// Reconcile/revoke the previous binding generation before minting the new token.
if (\app\adminapi\service\iam\v2\IamV2Client::enabled()) {
(new \app\adminapi\service\iam\v2\IamV2Manager())->assertLinked((int) $admin->id);
}
$result = (array) (new LoginLogic())->login(['account' => $admin->account, 'terminal' => AdminTerminalEnum::PC]);
if (\app\adminapi\service\iam\v2\IamV2Client::enabled()) {
\app\adminapi\service\iam\v2\IamV2Source::enroll($result['token'], 'oidc', true, (int) ($transaction['auth_time'] ?? 0));
}
return $result;