Files
outline/server/presenters/oauthAuthentication.ts

17 lines
574 B
TypeScript

import { OAuthAuthentication } from "@server/models";
import { presentPublishedOAuthClient } from "./oauthClient";
export default function presentOAuthAuthentication(
oauthAuthentication: OAuthAuthentication
) {
return {
id: oauthAuthentication.id,
userId: oauthAuthentication.userId,
oauthClientId: oauthAuthentication.oauthClientId,
oauthClient: presentPublishedOAuthClient(oauthAuthentication.oauthClient),
scope: oauthAuthentication.scope,
lastActiveAt: oauthAuthentication.lastActiveAt,
createdAt: oauthAuthentication.createdAt,
};
}