Skip to content

Commit bbfedf9

Browse files
committed
Scimmy: Remove the cast to express.Router
This issue is now solved: scimmyjs/scimmy-routers#24
1 parent ed9ddec commit bbfedf9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/server/lib/scim/v2/ScimV2Api.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,16 @@ const buildScimRouterv2 = (dbManager: HomeDBManager, installAdmin: InstallAdmin)
3636

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

4950
return v2.use('/', scimmyRouter);
5051
};

0 commit comments

Comments
 (0)