mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 22:55:24 +00:00
feat: move totp and passkeys into plugins (C1)
This commit is contained in:
1 parent
f4f26a9b8b
commit
5c18435105
235 files changed
+22545
-5610
No files matched your search
@@ -24,6 +24,8 @@ interface ActorStore {
|
||||
userId: string;
|
||||
/** Where the identity came from, for the audit line. */
|
||||
source: "request" | "asUser" | "service";
|
||||
/** The session a request came in on, so core can spare it when revoking. */
|
||||
sessionId?: string;
|
||||
}
|
||||
|
||||
const storage = new AsyncLocalStorage<ActorStore>();
|
||||
@@ -32,8 +34,13 @@ export function runAsActor<T>(
|
||||
userId: string,
|
||||
source: ActorStore["source"],
|
||||
fn: () => T,
|
||||
sessionId?: string,
|
||||
): T {
|
||||
return storage.run({ userId, source }, fn);
|
||||
return storage.run({ userId, source, sessionId }, fn);
|
||||
}
|
||||
|
||||
export function getActorSessionId(): string | undefined {
|
||||
return storage.getStore()?.sessionId;
|
||||
}
|
||||
|
||||
export function getActor(): string | undefined {
|
||||
|
||||
Reference in new issue
Block a user