delight-im / PHP-Auth

Authentication for PHP. Simple, lightweight and secure.
MIT License
1.11k stars 235 forks source link

No verification #268

Closed thatcoolguy closed 2 years ago

thatcoolguy commented 2 years ago

"If you don’t want to perform email verification, just omit the last parameter to Auth#register. The new user will be active immediately, then."

What is that supposed to mean? I tried stripping $token, both (token and selector) and it still verified->0

how can I disable the verification?

ocram commented 2 years ago

The last parameter passed to Auth#register is the complete closure or anonymous function

function ($selector, $token) { /* ... */ }

so remove that whole function here. It would then be something like this:

$userId = $auth->register($_POST['email'], $_POST['password'], $_POST['username']);

Does that help?

thatcoolguy commented 2 years ago

@ocram Hey Marco,

thank you for the help, I believe that's the first thing I tried yesterday but it wasn't working for some reason, probably I have another error. Well, it's so well documented and sometimes all we need is a little bit of rest I guess. Thank you, you can mark this as solved!

ocram commented 2 years ago

Thanks, no problem. I’ve improved the README to clarify which parameter it is referring to: https://github.com/delight-im/PHP-Auth/commit/79cc24931811f01a207cf0eb36b71cb84c71390b