MCPcopy Create free account
hub / github.com/code100x/cms / GetAppxAuthToken

Function GetAppxAuthToken

src/actions/user/index.ts:39–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37}
38
39export const GetAppxAuthToken = async (): Promise<GetAppxAuthTokenResponse> => {
40 const session = await getServerSession(authOptions);
41 if (!session || !session.user) throw new Error("User is not logged in");
42
43 const user = await db.user.findFirst({
44 where: {
45 email: session.user.email,
46 },
47 select: {
48 name: true,
49 email: true,
50 appxAuthToken: true,
51 appxUserId: true
52 }
53 });
54
55 if (!user || !user.appxAuthToken) throw new Error("User not found");
56 return user;
57};
58
59export const GetAppxVideoPlayerUrl = async (courseId: string, videoId: string): Promise<string> => {
60 const { name, email, appxAuthToken, appxUserId } = await GetAppxAuthToken();

Callers 1

GetAppxVideoPlayerUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected