add parameter application on api reset password
This commit is contained in:
@ -257,17 +257,24 @@ export class AuthController {
|
|||||||
static async resetPassword(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async resetPassword(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['Auth']
|
#swagger.tags = ['Auth']
|
||||||
#swagger.parameters['email'] = {
|
#swagger.parameters['email'] = {
|
||||||
in: 'path',
|
in: 'path',
|
||||||
description: 'Email',
|
description: 'Email',
|
||||||
required: true,
|
required: true,
|
||||||
type: 'string'
|
type: 'string'
|
||||||
}
|
}
|
||||||
|
#swagger.parameters['application'] = {
|
||||||
|
in: 'path',
|
||||||
|
description: 'Application',
|
||||||
|
required: true,
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const schema = Joi.object().keys({
|
const schema = Joi.object().keys({
|
||||||
email: Joi.string().email().required().label('Email'),
|
email: Joi.string().email().required().label('Email'),
|
||||||
|
application: Joi.string().required().label('Application'),
|
||||||
});
|
});
|
||||||
|
|
||||||
const param: User = await schema.validateAsync(req.params);
|
const param: User = await schema.validateAsync(req.params);
|
||||||
@ -321,12 +328,18 @@ export class AuthController {
|
|||||||
static async renewToken(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async renewToken(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['Auth']
|
#swagger.tags = ['Auth']
|
||||||
#swagger.parameters['refresh_token'] = {
|
#swagger.parameters['refresh_token'] = {
|
||||||
in: 'path',
|
in: 'path',
|
||||||
description: 'Refresh Token',
|
description: 'Refresh Token',
|
||||||
required: true,
|
required: true,
|
||||||
type: 'string'
|
type: 'string'
|
||||||
}
|
}
|
||||||
|
#swagger.parameters['application'] = {
|
||||||
|
in: 'path',
|
||||||
|
description: 'Application',
|
||||||
|
required: true,
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
const schema = Joi.object().keys({
|
const schema = Joi.object().keys({
|
||||||
|
|||||||
@ -9,7 +9,7 @@ export class RoutePublic {
|
|||||||
app.use(Language.apply);
|
app.use(Language.apply);
|
||||||
|
|
||||||
app.post('/api/login', AuthController.login)
|
app.post('/api/login', AuthController.login)
|
||||||
app.put('/api/reset_password/:email', AuthController.resetPassword)
|
app.put('/api/reset_password/:email/:application', AuthController.resetPassword)
|
||||||
app.put('/api/update_password/:token', AuthController.updatePassword)
|
app.put('/api/update_password/:token', AuthController.updatePassword)
|
||||||
app.put('/api/logout/:refresh_token', AuthController.logout)
|
app.put('/api/logout/:refresh_token', AuthController.logout)
|
||||||
app.put('/api/renew_token/:refresh_token/:application', AuthController.renewToken)
|
app.put('/api/renew_token/:refresh_token/:application', AuthController.renewToken)
|
||||||
|
|||||||
Reference in New Issue
Block a user