Skip to content

Commit

Permalink
fix(auth): check visitorHistory.visits array from fingerprint if unde…
Browse files Browse the repository at this point in the history
…fined
  • Loading branch information
rhahao authored Sep 25, 2022
1 parent 9dab2f5 commit 9baddcf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/auth-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const loginUser = async (req, res, next) => {
limit: 1,
});

if (visitorHistory.visits.length === 0) {
if (visitorHistory.visits?.length === 0) {
res.locals.failedLoginAttempt = true;
res.locals.type = 'warn';
res.locals.message = 'the authentication request seems to be fraudulent';
Expand Down

0 comments on commit 9baddcf

Please sign in to comment.