update login auth
This commit is contained in:
@ -36,7 +36,7 @@ export class AuthController {
|
|||||||
try {
|
try {
|
||||||
const schema = Joi.object().keys({
|
const schema = Joi.object().keys({
|
||||||
username: Joi.string().max(64).required().label('Username'),
|
username: Joi.string().max(64).required().label('Username'),
|
||||||
password: Joi.string().alphanum().min(6).required().label('Password')
|
password: Joi.string().min(8).required().label('Password')
|
||||||
});
|
});
|
||||||
|
|
||||||
const param: User = await schema.validateAsync(req.body);
|
const param: User = await schema.validateAsync(req.body);
|
||||||
|
|||||||
@ -287,7 +287,7 @@ export class UserActivityController {
|
|||||||
|
|
||||||
await OrmHelper.DB.manager.save(data);
|
await OrmHelper.DB.manager.save(data);
|
||||||
|
|
||||||
return ReturnHelper.successResponseAny(res, 200, Language.lang.success_insert, data);
|
return ReturnHelper.successResponseAny(res, 200, Language.lang.success_insert, {});
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
log.error(e);
|
log.error(e);
|
||||||
const err = e as Error;
|
const err = e as Error;
|
||||||
|
|||||||
@ -4,6 +4,13 @@ import express from 'express';
|
|||||||
|
|
||||||
export class MorganHelper {
|
export class MorganHelper {
|
||||||
static setup(app: express.Application) {
|
static setup(app: express.Application) {
|
||||||
|
// app.use(function (req, res, next) {
|
||||||
|
// req.headers.authorization = 'Bearer ' + req.query.token;
|
||||||
|
// req.query.token = '';
|
||||||
|
|
||||||
|
// next();
|
||||||
|
// });
|
||||||
|
|
||||||
app.use(morgan(config.get('server.morgan')));
|
app.use(morgan(config.get('server.morgan')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user