identity.logout()
请求退出,并由可信 UI 明确说明影响范围。guest 不能无确认销毁所有应用或所有设备的全局会话。
Syntax
await host.identity.logout();
Examples
logoutButton.onclick = async () => {
await host.identity.logout();
renderAccountControls((await host.identity.status()).authenticated);
};
Errors
activation-required、denied、platform-unavailable。用户取消确认不抛错。
Requirements
- 能力:
host:identity.logout - 可信用户激活与确认:必须
- 信任档位:满足平台托管五项条件时为 green