Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PB-2153] feat: remove password validation from two factor authentication #460

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/app/routes/twofactor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

const { passportAuth } = passport;

module.exports = (Router, Service, App) => {

Check warning on line 8 in src/app/routes/twofactor.js

View workflow job for this annotation

GitHub Actions / run-tests (16.x)

'App' is defined but never used

Check warning on line 8 in src/app/routes/twofactor.js

View workflow job for this annotation

GitHub Actions / build (16.x)

'App' is defined but never used
/**
* Gets a new 2FA code
* Only auth. users can generate a new code.
Expand Down Expand Up @@ -89,12 +89,7 @@
window: 2,
});

// Check user password is valid
const decryptedPass = App.services.Crypt.decryptText(req.body.pass);

if (userData.password.toString() !== decryptedPass) {
res.status(500).send({ error: 'Invalid password' });
} else if (!isValid) {
if (!isValid) {
res.status(500).send({
error: 'Invalid 2FA code. Please, use an updated code.',
});
Expand Down
Loading