mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 03:14:29 +00:00
function def
This commit is contained in:
@@ -4,10 +4,12 @@ import { getMostRecentCookieWithLoginname } from "./cookies";
|
||||
|
||||
export async function loadMostRecentSession(
|
||||
sessionService: any, // TODO: SessionServiceClient,
|
||||
loginName?: string,
|
||||
organization?: string,
|
||||
sessionParams: { loginName?: string; organization?: string },
|
||||
): Promise<Session | undefined> {
|
||||
const recent = await getMostRecentCookieWithLoginname({ loginName, organization });
|
||||
const recent = await getMostRecentCookieWithLoginname({
|
||||
loginName: sessionParams.loginName,
|
||||
organization: sessionParams.organization,
|
||||
});
|
||||
return sessionService
|
||||
.getSession({ sessionId: recent.id, sessionToken: recent.token }, {})
|
||||
.then((resp: GetSessionResponse) => resp.session);
|
||||
|
||||
Reference in New Issue
Block a user