Implement Auth account page

This commit is contained in:
Takeshi Kimata
2024-05-19 20:25:09 +09:00
parent a5b218f55e
commit 076f7c74d4
25 changed files with 119 additions and 40 deletions

View File

@@ -11,7 +11,7 @@ module.exports = function (sequelize) {
router.post("/signup", async (req, res) => {
try {
const { email, password, username } = req.body;
const { email, password, username, avatarPath } = req.body;
const hashedPassword = await bcrypt.hash(password, 10);
const userCount = await User.count();
@@ -25,7 +25,7 @@ module.exports = function (sequelize) {
password: hashedPassword,
username: username,
role: initialRole,
avatarPath: null,
avatarPath: avatarPath,
});
const accessToken = jwt.sign({ userId: user.id }, "your-secret-key", {