feat(iam): provision authorized first-login users as medical assistants

This commit is contained in:
2026-09-10 12:15:15 +08:00
parent f8b6196205
commit 6325ba88ff
6 changed files with 297 additions and 4 deletions
@@ -101,8 +101,7 @@ final class IamLoginService
private function verifiedAdmin(string $subject): Admin
{
$context = $this->client->provisioning($subject);
$id = self::boundAdminId($context, $subject, $this->config['application_id']);
$id = (new IamAccountProvisioner())->resolve($this->client, $this->config, $subject);
$admin = Admin::findOrEmpty($id);
if ($admin->isEmpty() || (int) $admin->disable !== 0 || !empty($admin->getData('delete_time'))) {
throw new RuntimeException('甄养堂账号已停用,请联系管理员');