Example commit
This commit is contained in:
parent
ccf14fcd6b
commit
30160a93af
@ -22,7 +22,7 @@ async function addAuthRoutes(app: Application) {
|
|||||||
const userService = new UserService();
|
const userService = new UserService();
|
||||||
const user = await userService.login(username, password);
|
const user = await userService.login(username, password);
|
||||||
|
|
||||||
if (user) {
|
if (user) { //test
|
||||||
const token = jwt.sign({ id: user.id }, config.JWT_SECRET, { expiresIn: '1h' });
|
const token = jwt.sign({ id: user.id }, config.JWT_SECRET, { expiresIn: '1h' });
|
||||||
return res.status(200).json({ token });
|
return res.status(200).json({ token });
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user