emby支持无密码登录

This commit is contained in:
mtvpls
2026-03-07 10:19:38 +08:00
parent 82e6a33b00
commit 047691d1a5
3 changed files with 136 additions and 61 deletions
+3 -3
View File
@@ -115,9 +115,9 @@ export class EmbyClient {
// 如果有 AuthToken,假设它是有效的
if (this.authToken) return;
// 如果有用户名和密码,自动认证
if (this.username && this.password) {
const authResult = await this.authenticate(this.username, this.password);
// 如果有用户名,自动认证(密码可选)
if (this.username) {
const authResult = await this.authenticate(this.username, this.password || '');
this.authToken = authResult.AccessToken;
this.userId = authResult.User.Id;
}