From 1ce7879ee85ea5bb5efaff3cf950e65513098d3c Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Sat, 25 Mar 2023 16:09:04 -0400 Subject: oapi: users progress --- src/api/routes/users/@me/mfa/codes-verification.ts | 15 ++++++++++++++- src/api/routes/users/@me/mfa/codes.ts | 18 +++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) (limited to 'src/api/routes/users/@me/mfa') diff --git a/src/api/routes/users/@me/mfa/codes-verification.ts b/src/api/routes/users/@me/mfa/codes-verification.ts index 7459ede3..7e336e5a 100644 --- a/src/api/routes/users/@me/mfa/codes-verification.ts +++ b/src/api/routes/users/@me/mfa/codes-verification.ts @@ -30,7 +30,20 @@ const router = Router(); router.post( "/", - route({ requestBody: "CodesVerificationSchema" }), + route({ + requestBody: "CodesVerificationSchema", + responses: { + 200: { + body: "UserBackupCodesResponse", + }, + 400: { + body: "APIErrorResponse", + }, + 404: { + body: "APIErrorResponse", + }, + }, + }), async (req: Request, res: Response) => { // const { key, nonce, regenerate } = req.body as CodesVerificationSchema; const { regenerate } = req.body as CodesVerificationSchema; diff --git a/src/api/routes/users/@me/mfa/codes.ts b/src/api/routes/users/@me/mfa/codes.ts index 178e25c9..7a60522a 100644 --- a/src/api/routes/users/@me/mfa/codes.ts +++ b/src/api/routes/users/@me/mfa/codes.ts @@ -33,7 +33,23 @@ const router = Router(); router.post( "/", - route({ requestBody: "MfaCodesSchema" }), + route({ + requestBody: "MfaCodesSchema", + deprecated: true, + description: + "This route is replaced with users/@me/mfa/codes-verification in newer clients", + responses: { + 200: { + body: "UserBackupCodesResponse", + }, + 400: { + body: "APIErrorResponse", + }, + 404: { + body: "APIErrorResponse", + }, + }, + }), async (req: Request, res: Response) => { const { password, regenerate } = req.body as MfaCodesSchema; -- cgit 1.4.1