refactor: add server side validation schema for authProviders (#4876)
* refactor: move files to subfolder * refactor: schema for authenticationProviders.info * refactor: schema for authenticationProviders.update * refactor: use validated body
This commit is contained in:
committed by
GitHub
parent
ab7b20958b
commit
0976e85a1a
@@ -15,7 +15,7 @@ router.post(
|
||||
auth({ member: true }),
|
||||
validate(T.APIKeysCreateSchema),
|
||||
async (ctx: APIContext<T.APIKeysCreateReq>) => {
|
||||
const { name } = ctx.request.body;
|
||||
const { name } = ctx.input.body;
|
||||
const { user } = ctx.state.auth;
|
||||
|
||||
authorize(user, "createApiKey", user.team);
|
||||
@@ -68,7 +68,7 @@ router.post(
|
||||
auth({ member: true }),
|
||||
validate(T.APIKeysDeleteSchema),
|
||||
async (ctx: APIContext<T.APIKeysDeleteReq>) => {
|
||||
const { id } = ctx.request.body;
|
||||
const { id } = ctx.input.body;
|
||||
const { user } = ctx.state.auth;
|
||||
|
||||
const key = await ApiKey.findByPk(id);
|
||||
|
||||
Reference in New Issue
Block a user