oops
This commit is contained in:
parent
2e7defbf61
commit
3fea41977f
|
@ -91,8 +91,9 @@ apiRouter.put("/email-verification", async (req, res, next) => {
|
|||
}
|
||||
});
|
||||
|
||||
apiRouter.post("/user/upgrade", async (req, res, next) => {
|
||||
apiRouter.put("/user/upgrade", async (req, res, next) => {
|
||||
if (!req.user) throw new Error("user not found");
|
||||
try {
|
||||
const givenPassword = (req.body.password || "") as string;
|
||||
const studentPassword = env.upgradePassword;
|
||||
if (givenPassword.toLowerCase().trim() !== studentPassword.toLowerCase()) {
|
||||
|
@ -122,6 +123,9 @@ apiRouter.post("/user/upgrade", async (req, res, next) => {
|
|||
user: u,
|
||||
};
|
||||
res.send(upgraded);
|
||||
} catch (e) {
|
||||
next(e);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue