Implement Auth account dropdown

This commit is contained in:
Takeshi Kimata
2024-05-19 13:33:08 +09:00
parent 3d141cf05b
commit a5b218f55e
11 changed files with 172 additions and 66 deletions

View File

@@ -24,10 +24,10 @@ module.exports = function (sequelize) {
if (!passwordMatch) {
return res.status(401).json({ error: "Authentication failed" });
}
const token = jwt.sign({ userId: user.id }, "your-secret-key", {
const accessToken = jwt.sign({ userId: user.id }, "your-secret-key", {
expiresIn: "1h",
});
res.status(200).json({ token });
res.status(200).json({ access_token: accessToken, user });
} catch (error) {
console.error(error);
res.status(500).send("Sign up failed");