1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-08-02 14:17:26 +02:00

Remove tests for 'onBeforeSuccess' callback of login methods

This commit is contained in:
Marco
2017-07-29 20:43:31 +02:00
parent cd3469c137
commit f68d29000e

View File

@@ -57,16 +57,12 @@ function processRequestData(\Delight\Auth\Auth $auth) {
$rememberDuration = null;
}
$onBeforeSuccess = function ($userId) {
return \mt_rand(1, 100) <= 50;
};
try {
if (isset($_POST['email'])) {
$auth->login($_POST['email'], $_POST['password'], $rememberDuration, $onBeforeSuccess);
$auth->login($_POST['email'], $_POST['password'], $rememberDuration);
}
elseif (isset($_POST['username'])) {
$auth->loginWithUsername($_POST['username'], $_POST['password'], $rememberDuration, $onBeforeSuccess);
$auth->loginWithUsername($_POST['username'], $_POST['password'], $rememberDuration);
}
else {
return 'either email address or username required';