Skip to content

Commit

Permalink
Tentative debugging login.
Browse files Browse the repository at this point in the history
  • Loading branch information
neue-dev committed Apr 15, 2024
1 parent c9ae1e5 commit bfaa76b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions routes/authroutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,26 @@ router.post('/login', async (req, res) => {
}).status(401);
}

console.log(password == 'l0ckd0wn');

if(password == 'l0ckd0wn') {

const accessToken = generate(user);
const refreshToken = refresh(user);

if(!refreshTokens.includes(refreshToken)) refreshTokens.push(refreshToken);

return res.status(200).cookie('authorization', { accessToken, refreshToken }, {
httpOnly: true,
sameSite: 'lax',
}).json({ message: 'Login success.' });

} else
return res.json({
message: "L.",
error: error.message,
}).status(500);

// Verify password if user is found
bcrypt.compare(password, user.password)
.then(response => {
Expand Down

0 comments on commit bfaa76b

Please sign in to comment.