Skip to content

Commit

Permalink
Merge pull request #17 from andela/feature/167164983/forgot-password
Browse files Browse the repository at this point in the history
#167164983 Forgot Password Functionality
  • Loading branch information
joel-ace authored Jul 30, 2019
2 parents 8fdd537 + ec3c272 commit 1248009
Show file tree
Hide file tree
Showing 24 changed files with 701 additions and 304 deletions.
5 changes: 5 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
NODE_ENV=
PORT=
SECRET_KEY=
DATABASE_URL_DEV=
DATABASE_URL_TEST=
SERVER_URL=
ADMIN_MAIL=
SENDGRID_API_KEY=
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cache:
before_script:
- psql -c 'create database travis_ci_test;' -U postgres

script: npm run coverage
script: npm run test

after_success:
- npm run coveralls
Expand Down
71 changes: 65 additions & 6 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,57 @@ paths:
$ref: '#/components/schemas/AuthResponse'
400:
description: bad input parameter
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
field:
type: string
example: email
message:
type: string
example: the email address you supplied is invalid
409:
description: resource already exists
500:
description: internal server error
description: internal server error
/auth/forgotpassword:
post:
summary: Forgot password
description: Sends an email to a user with the reset password link
requestBody:
content:
application/json:
schema:
type: object
properties:
email:
type: string
responses:
200:
description: succesful request
content:
application/json:
schema:
$ref: '#/components/schemas/StandardServerResponse'
404:
description: user not found
content:
application/json:
schema:
$ref: '#/components/schemas/StandardServerResponse'
500:
description: server error
content:
application/json:
schema:
$ref: '#/components/schemas/StandardServerResponse'
components:
schemas:
User:
Expand Down Expand Up @@ -112,17 +159,29 @@ components:
type: string
example: Flyplanex22
AuthResponse:
type: object
properties:
email:
type: string
token:
type: string
username:
type: string
bio:
type: string

ForgotPasswordUser:
required:
- email
type: object
properties:
email:
type: string
example: example@gmail.com
StandardServerResponse:
type: object
properties:
status:
type: string
example: success
message:
type: string
example: internal server error
securitySchemes:
ApiKeyAuth:
type: apiKey
Expand Down
Loading

0 comments on commit 1248009

Please sign in to comment.