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

Add incorrect password timeouts #33

Open
alarner opened this issue Jun 30, 2016 · 2 comments
Open

Add incorrect password timeouts #33

alarner opened this issue Jun 30, 2016 · 2 comments

Comments

@alarner
Copy link
Owner

alarner commented Jun 30, 2016

If a user enters in an incorrect password too many times (this should be configurable in config/auth.js) they should be locked out from logging in for a configurable amount of time.

This will involve creating a new table to keep track of authentication attempts and whether or not they were successful and from which IP addresses.

@alarner
Copy link
Owner Author

alarner commented Aug 18, 2016

Schema might look something like this:

CREATE TABLE IF NOT EXISTS `user_auth_attempts` (
    `user_auth_attempt_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    `auth_type` TINYINT(4) UNSIGNED NOT NULL,
    `auth_identifier` VARCHAR(255) NOT NULL,
    `auth_error` TINYINT(3) UNSIGNED DEFAULT 0,
    `ip` VARCHAR(40) DEFAULT NULL,
    `date` DATETIME NOT NULL,
    PRIMARY KEY (`user_auth_attempt_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

@alarner
Copy link
Owner Author

alarner commented Aug 18, 2016

Here's the file where we need to hook in the logging of attempts: https://github.com/alarner/perk/blob/master/routes/auth.js#L129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant