mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 20:16:28 +00:00
update
This commit is contained in:
@@ -33,10 +33,6 @@ const validate = (method) => {
|
||||
return [
|
||||
body("mid").not().isEmpty().withMessage("MID is required"),
|
||||
body("tid").not().isEmpty().withMessage("TID is required"),
|
||||
body("refresh_token")
|
||||
.not()
|
||||
.isEmpty()
|
||||
.withMessage("Refresh Token is required"),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -78,7 +74,10 @@ const login = async (req, res, next) => {
|
||||
}
|
||||
|
||||
// check password
|
||||
let checkPassword = await bcrypt.compare(password, checkDataLogin.c_password_hash);
|
||||
let checkPassword = await bcrypt.compare(
|
||||
password,
|
||||
checkDataLogin.c_password_hash
|
||||
);
|
||||
if (!checkPassword) {
|
||||
return res.status(200).json({
|
||||
code: "01",
|
||||
@@ -190,11 +189,11 @@ const register = async (req, res) => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// REFRESH TOKEN
|
||||
const refreshToken = async (req, res) => {
|
||||
try {
|
||||
const { mid, tid, refresh_token } = req.body;
|
||||
const { mid, tid } = req.body;
|
||||
const refresh_token = req.header("refresh_token");
|
||||
|
||||
// validate
|
||||
const err = validationResult(req);
|
||||
|
||||
Reference in New Issue
Block a user