MCPcopy Index your code
hub / github.com/freeCodeCamp/freeCodeCamp / getSessionUser

Function getSessionUser

client/src/utils/ajax.ts:152–167  ·  view source on GitHub ↗
(
  signal?: AbortSignal
)

Source from the content-addressed store, hash-verified

150}
151
152export function getSessionUser(
153 signal?: AbortSignal
154): Promise<ResponseWithData<User | null>> {
155 const responseWithData: Promise<ResponseWithData<ApiUserResponse>> = get(
156 '/user/session-user',
157 signal
158 );
159 // TODO: Once DB is migrated, no longer need to parse `files` -> `challengeFiles` etc.
160 return responseWithData.then(({ response, data }) => {
161 const user = parseApiResponseToClientUser(data);
162 return {
163 response,
164 data: user
165 };
166 });
167}
168
169type UserProfileResponse = {
170 entities: Omit<ApiUserResponse, 'result'>;

Callers

nothing calls this directly

Calls 2

getFunction · 0.85

Tested by

no test coverage detected