Skip to content

Commit

Permalink
Scimmy: Remove the cast to express.Router
Browse files Browse the repository at this point in the history
This issue is now solved:
scimmyjs/scimmy-routers#24
  • Loading branch information
fflorent committed Jan 11, 2025
1 parent 1f7df84 commit e29b697
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/server/lib/scim/v2/ScimV2Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ const buildScimRouterv2 = (dbManager: HomeDBManager, installAdmin: InstallAdmin)

return String(mreq.userId); // SCIMMYRouters requires the userId to be a string.
},
context: async (mreq: RequestWithLogin): Promise<RequestContext> => {
context: async (req: express.Request): Promise<RequestContext> => {
const mreq = req as RequestWithLogin;
const isAdmin = await installAdmin.isAdminReq(mreq);
const isScimUser = Boolean(
process.env.GRIST_SCIM_EMAIL && mreq.user?.loginEmail === process.env.GRIST_SCIM_EMAIL
);
const path = mreq.path;
return { isAdmin, isScimUser, path };
}
}) as express.Router; // Have to cast it into express.Router. See https://github.com/scimmyjs/scimmy-routers/issues/24
});

return v2.use('/', scimmyRouter);
};
Expand Down

0 comments on commit e29b697

Please sign in to comment.