0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

chore(test): add SIE API guard (#3774)

This commit is contained in:
Darcy Ye 2023-04-28 11:12:57 +08:00 committed by GitHub
parent 6a463f6a2a
commit 64a01f18d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,11 +21,18 @@ export default function signInExperiencesRoutes<T extends AuthedRouter>(
* As we only support single signInExperience settings for V1 * As we only support single signInExperience settings for V1
* always return the default settings in DB for the /sign-in-exp get method * always return the default settings in DB for the /sign-in-exp get method
*/ */
router.get('/sign-in-exp', async (ctx, next) => { router.get(
ctx.body = await findDefaultSignInExperience(); '/sign-in-exp',
koaGuard({
response: SignInExperiences.guard,
status: [200],
}),
async (ctx, next) => {
ctx.body = await findDefaultSignInExperience();
return next(); return next();
}); }
);
router.patch( router.patch(
'/sign-in-exp', '/sign-in-exp',
@ -40,6 +47,8 @@ export default function signInExperiencesRoutes<T extends AuthedRouter>(
}) })
) )
.partial(), .partial(),
response: SignInExperiences.guard,
status: [200],
}), }),
async (ctx, next) => { async (ctx, next) => {
const { const {