Device management

This commit is contained in:
Rory& committed 2025-12-16 11:47:20 +01:00
1 parent 9b786925b7
commit d7a950d0e7
5 files changed
+149 -1

No files matched your search

+19 -1
View File
@@ -87,10 +87,28 @@ export class Session extends BaseClassWithoutId {
client_info: {
os: this.client_info.os,
client: this.client_info.client,
location: this.last_seen_location
location: this.last_seen_location,
},
};
}
getExtendedDeviceInfo() {
return {
id: this.session_id,
id_hash: crypto.createHash("sha256").update(this.session_id).digest("hex"),
status: this.status,
activities: this.activities,
client_status: this.client_status,
approx_last_used_time: this.last_seen.toISOString(),
client_info: {
...this.client_info,
location: this.last_seen_location,
},
last_seen: this.last_seen,
last_seen_ip: this.last_seen_ip,
last_seen_location: this.last_seen_location,
};
}
}
export const PrivateSessionProjection: (keyof Session)[] = ["user_id", "session_id", "activities", "client_info", "status"];