Transform the account field in sessions
When serving sessions instead of passing the ServerUser directly, convert it to the ApiAccount format.
This commit is contained in:
parent
37edf122a1
commit
adeef4f629
2 changed files with 19 additions and 2 deletions
|
@ -15,6 +15,7 @@ import {
|
|||
} from "~/server/database";
|
||||
import { broadcastEvent } from "../streams";
|
||||
import type { ApiAuthenticationProvider, ApiSession } from "~/shared/types/api";
|
||||
import { serverUserToApiAccount } from "./user";
|
||||
|
||||
async function removeSessionSubscription(sessionId: number) {
|
||||
const subscriptions = await readSubscriptions();
|
||||
|
@ -182,7 +183,7 @@ export async function serverSessionToApi(event: H3Event, session: ServerSession)
|
|||
|
||||
return {
|
||||
id: session.id,
|
||||
account,
|
||||
account: serverUserToApiAccount(account),
|
||||
authenticationProvider: session.authenticationProvider,
|
||||
authenticationName: session.authenticationName,
|
||||
push,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue