feat: add live camera multi-device viewer mode

这个提交包含在:
cryptocommuniums-afk
2026-03-16 16:39:14 +08:00
父节点 f0bbe4c82f
当前提交 4e4122d758
修改 15 个文件,包含 1523 行新增110 行删除

查看文件

@@ -260,7 +260,11 @@ class SDKServer {
}
async authenticateRequest(req: Request): Promise<User> {
// Regular authentication flow
const authenticated = await this.authenticateRequestWithSession(req);
return authenticated.user;
}
async authenticateRequestWithSession(req: Request): Promise<{ user: User; sid: string | null }> {
const cookies = this.parseCookies(req.headers.cookie);
const sessionCookie = cookies.get(COOKIE_NAME);
const session = await this.verifySession(sessionCookie);
@@ -273,7 +277,6 @@ class SDKServer {
const signedInAt = new Date();
let user = await db.getUserByOpenId(sessionUserId);
// If user not in DB, sync from OAuth server automatically
if (!user) {
try {
const userInfo = await this.getUserInfoWithJwt(sessionCookie ?? "");
@@ -300,7 +303,10 @@ class SDKServer {
lastSignedIn: signedInAt,
});
return user;
return {
user,
sid: session.sid ?? null,
};
}
}