Skip to content

Commit

Permalink
Refactor confirmSignup function to use event object instead of req an…
Browse files Browse the repository at this point in the history
…d res
  • Loading branch information
Sowri19 committed Apr 14, 2024
1 parent 1506751 commit 248241f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions controller/authController.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ export const signup = async (req, res) => {
});
}
};

export const confirmSignup = async (req, res) => {
const { email, verificationCode, password } = req.body;
export const confirmSignup = async (event) => {
const { email, verificationCode, password } = JSON.parse(event.body);
const user = new User(email, password);

try {
Expand All @@ -37,7 +36,7 @@ export const confirmSignup = async (req, res) => {
30 * 24 * 60 * 60
}; Secure; Path=/`,
"Access-Control-Allow-Credentials": true,
"Access-Control-Allow-Origin": req.headers.origin,
"Access-Control-Allow-Origin": event.headers.origin,
},
body: JSON.stringify({
success: true,
Expand Down

0 comments on commit 248241f

Please sign in to comment.