diff options
author | Puyodead1 <puyodead@proton.me> | 2023-03-25 18:01:56 -0400 |
---|---|---|
committer | Puyodead1 <puyodead@proton.me> | 2023-04-13 15:39:31 -0400 |
commit | 860b9d583e720ba5e3d003e1eaca81faf22e360f (patch) | |
tree | d5c8301f756fe4e4a3b85dc7f58f6003f5f62c65 /src/api/routes/users/@me/mfa/totp | |
parent | oapi: users progress (diff) | |
download | server-860b9d583e720ba5e3d003e1eaca81faf22e360f.tar.xz |
oapi: finish users
Diffstat (limited to 'src/api/routes/users/@me/mfa/totp')
-rw-r--r-- | src/api/routes/users/@me/mfa/totp/disable.ts | 12 | ||||
-rw-r--r-- | src/api/routes/users/@me/mfa/totp/enable.ts | 15 |
2 files changed, 25 insertions, 2 deletions
diff --git a/src/api/routes/users/@me/mfa/totp/disable.ts b/src/api/routes/users/@me/mfa/totp/disable.ts index bade76c3..362152d7 100644 --- a/src/api/routes/users/@me/mfa/totp/disable.ts +++ b/src/api/routes/users/@me/mfa/totp/disable.ts @@ -31,7 +31,17 @@ const router = Router(); router.post( "/", - route({ requestBody: "TotpDisableSchema" }), + route({ + requestBody: "TotpDisableSchema", + responses: { + 200: { + body: "TokenOnlyResponse", + }, + 400: { + body: "APIErrorResponse", + }, + }, + }), async (req: Request, res: Response) => { const body = req.body as TotpDisableSchema; diff --git a/src/api/routes/users/@me/mfa/totp/enable.ts b/src/api/routes/users/@me/mfa/totp/enable.ts index 87bbaec9..19836e4d 100644 --- a/src/api/routes/users/@me/mfa/totp/enable.ts +++ b/src/api/routes/users/@me/mfa/totp/enable.ts @@ -32,7 +32,20 @@ const router = Router(); router.post( "/", - route({ requestBody: "TotpEnableSchema" }), + route({ + requestBody: "TotpEnableSchema", + responses: { + 200: { + body: "TokenWithBackupCodesResponse", + }, + 400: { + body: "APIErrorResponse", + }, + 404: { + body: "APIErrorResponse", + }, + }, + }), async (req: Request, res: Response) => { const body = req.body as TotpEnableSchema; |