1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-08-06 08:07:27 +02:00

Create method 'Auth::createSelectorForOneTimePassword'

This commit is contained in:
Marco
2024-03-14 14:37:07 +01:00
parent e5310aa699
commit 8256fd11e8

View File

@@ -1922,6 +1922,13 @@ final class Auth extends UserManager {
);
}
private static function createSelectorForOneTimePassword($otpValue, $userId = null) {
$userId = !empty($userId) ? (int) $userId : 0;
$key = $userId . '#' . $otpValue;
return \substr(\sha1($key, false), 0, 24);
}
/**
* Returns the selector of a potential locally existing remember directive
*