fix(api): remove legacy get-session-user endpoint (#67089)

This commit is contained in:
Sem Bauke
2026-04-24 17:08:10 +02:00
committed by GitHub
parent ec06a99fdb
commit 9714ae3b70
3 changed files with 3 additions and 21 deletions

View File

@@ -187,7 +187,7 @@ const lockedProfileUI = {
};
// These are not part of the schema, but are added to the user object by
// get-session-user's handler
// session-user's handler
const computedProperties = {
calendar: {},
completedChallengeCount: 0,
@@ -198,7 +198,7 @@ const computedProperties = {
profileUI: lockedProfileUI
};
// The following appears in get-session-user responses, but not
// The following appears in session-user responses, but not
// get-public-profile
const sessionOnlyData = {
currentChallengeId: testUserData.currentChallengeId,
@@ -1639,16 +1639,6 @@ Thanks and regards,
expect(response.statusCode).toBe(200);
expect(response.body).toStrictEqual({ user: {}, result: '' });
});
test('GET legacy endpoint returns 200 with empty user object for unauthenticated users', async () => {
const response = await superRequest('/user/get-session-user', {
method: 'GET',
setCookies
});
expect(response.statusCode).toBe(200);
expect(response.body).toStrictEqual({ user: {}, result: '' });
});
});
});
});

View File

@@ -837,14 +837,6 @@ export const userGetRoutes: FastifyPluginCallbackTypebox = (
}
};
fastify.get(
'/user/get-session-user',
{
schema: schemas.getSessionUser
},
getSessionUserHandler
);
fastify.get(
'/user/session-user',
{

View File

@@ -391,7 +391,7 @@ describe('userRoutes', () => {
expect(response.statusCode).toBe(200);
});
// TODO: create a list of public properties like the api-server and use that
// to restrict the output of this and get-session-user.
// to restrict the output of this and session-user.
test('returns 200 status code with public user object', async () => {
const testUser =
await fastifyTestInstance.prisma.user.findFirstOrThrow({