feat: recover password & refresh token
This commit is contained in:
+130
-28
@@ -94,6 +94,16 @@ definitions:
|
||||
username:
|
||||
type: string
|
||||
type: object
|
||||
main.resetPasswordPayload:
|
||||
properties:
|
||||
new_password:
|
||||
type: string
|
||||
new_password_confirmation:
|
||||
type: string
|
||||
required:
|
||||
- new_password
|
||||
- new_password_confirmation
|
||||
type: object
|
||||
main.updateUserPasswordPayload:
|
||||
properties:
|
||||
current_password:
|
||||
@@ -238,6 +248,32 @@ info:
|
||||
termsOfService: http://swagger.io/terms/
|
||||
title: LK API Template
|
||||
paths:
|
||||
/admin/users:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Fetches all users
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/store.User'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema: {}
|
||||
"404":
|
||||
description: Not Found
|
||||
schema: {}
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema: {}
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Fetches all users
|
||||
tags:
|
||||
- admin
|
||||
/authentication/forgot-password:
|
||||
post:
|
||||
consumes:
|
||||
@@ -269,6 +305,64 @@ paths:
|
||||
summary: Forgot Password
|
||||
tags:
|
||||
- authentication
|
||||
/authentication/refresh:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Refresh a token for the user
|
||||
parameters:
|
||||
- description: Refresh Token
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"201":
|
||||
description: Token Created
|
||||
schema:
|
||||
type: string
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema: {}
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema: {}
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema: {}
|
||||
summary: Refresh a token
|
||||
tags:
|
||||
- authentication
|
||||
/authentication/register:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Register a new User
|
||||
parameters:
|
||||
- description: User Credentials
|
||||
in: body
|
||||
name: payload
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/main.RegisterUserPayload'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"201":
|
||||
description: User Registered
|
||||
schema:
|
||||
$ref: '#/definitions/main.UserWithToken'
|
||||
"400":
|
||||
description: User payload error
|
||||
schema: {}
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema: {}
|
||||
summary: Register a new User
|
||||
tags:
|
||||
- authentication
|
||||
/authentication/token:
|
||||
post:
|
||||
consumes:
|
||||
@@ -300,34 +394,6 @@ paths:
|
||||
summary: Create a new token
|
||||
tags:
|
||||
- authentication
|
||||
/authentication/user:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Register a new User
|
||||
parameters:
|
||||
- description: User Credentials
|
||||
in: body
|
||||
name: payload
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/main.RegisterUserPayload'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"201":
|
||||
description: User Registered
|
||||
schema:
|
||||
$ref: '#/definitions/main.UserWithToken'
|
||||
"400":
|
||||
description: User payload error
|
||||
schema: {}
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema: {}
|
||||
summary: Register a new User
|
||||
tags:
|
||||
- authentication
|
||||
/health:
|
||||
get:
|
||||
description: Health Check
|
||||
@@ -756,6 +822,42 @@ paths:
|
||||
summary: Fetches the user feed
|
||||
tags:
|
||||
- feed
|
||||
/users/reset-password/{token}:
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Reset user password with verification
|
||||
parameters:
|
||||
- description: Reset Password
|
||||
in: body
|
||||
name: payload
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/main.resetPasswordPayload'
|
||||
- description: Reset Password Token
|
||||
in: path
|
||||
name: token
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"204":
|
||||
description: Password reset successfully
|
||||
schema:
|
||||
type: string
|
||||
"400":
|
||||
description: Invalid request
|
||||
schema: {}
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema: {}
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema: {}
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Reset user password
|
||||
tags:
|
||||
- users
|
||||
securityDefinitions:
|
||||
ApiKeyAuth:
|
||||
in: header
|
||||
|
||||
Reference in New Issue
Block a user