Skip to content

Commit

Permalink
Swagger docs for email verification
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaMohd committed Feb 20, 2021
1 parent 8afebea commit 11b616f
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 7 deletions.
29 changes: 23 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,28 @@
{
"type": "node",
"request": "launch",
"name": "Launch via Yarn",
"runtimeExecutable": "yarn",
"cwd": "${workspaceFolder}",
"runtimeArgs": ["start:debug"],
"port": 5858
}
"name": "nodemon",
"runtimeExecutable": "nodemon",
"program": "${workspaceFolder}/app.js",
"restart": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"env": {
"NODE_ENV": "development"
},
"skipFiles": [
"<node_internals>/**"
]
},
// {
// "type": "node",
// "request": "launch",
// "name": "Launch via Yarn",
// "runtimeExecutable": "yarn",
// "cwd": "${workspaceFolder}",
// "runtimeArgs": ["start:debug"],
// "port": 5858
// }

]
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"scripts": {
"start": "pm2 start ecosystem.config.json --no-daemon",
"dev": "cross-env NODE_ENV=development nodemon src/index.js",
"dev:debug": "nodemon --inspect-brk=5858 src/index.js",
"test": "jest -i --colors --testEnvironment=node --verbose --coverage --detectOpenHandles",
"test:watch": "jest -i --watchAll",
"coverage": "jest -i --coverage",
Expand Down
59 changes: 59 additions & 0 deletions src/routes/v1/auth.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,62 @@ module.exports = router;
* code: 401
* message: Password reset failed
*/

/**
* @swagger
* path:
* /auth/verification-email:
* post:
* summary: verification-email Email
* description: An email will be sent to verify email.
* tags: [Auth]
* security:
* - bearerAuth: []
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* required:
* - email
* properties:
* email:
* type: string
* format: email
* example:
* email: fake@example.com
* responses:
* "204":
* description: No content
* "404":
* $ref: '#/components/responses/NotFound'
*/

/**
* @swagger
* path:
* /auth/verify-email:
* post:
* summary: verify email
* tags: [Auth]
* parameters:
* - in: query
* name: token
* required: true
* schema:
* type: string
* description: The verify email token
* responses:
* "204":
* description: No content
* "401":
* description: verify email failed
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Error'
* example:
* code: 401
* message: verify email failed
*/

0 comments on commit 11b616f

Please sign in to comment.