You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assuming onCheckEmail is not an official part of the plugin but just an example; this can be ignored I adjusted example the onCheckEmail() function because Auth::findUserByLogin returns TRUE if a user is found regardless of its value user->is_guest. In my case (and everyone elses?), it should also return FALSE if user->is_guest because even though the user already exists, the user with that specific e-mailadress is still available to be claimed by anyone.
I adjusted the function to solve this issue (which is not really an issue but not documented I guess).
~~public function onCheckEmail() {
// keep isTaken
$isTaken = 1;
// get email
$email = post('email');
// search the user
$user = Auth::findUserByLogin($email);
// if user is NOT found or user is guest -> account is still available to claim
if (!$user || $user->is_guest) $isTaken = 0;
return ['isTaken' => $isTaken];
}~~
This brings me to the next issue;
When the guest user finally wants to register, he gets a validation error that the e-mailadress is already in use because:
plugins/winter/user/components/Account.php (around line 295)
$rules = (new UserModel)->rules;
Which contains
plugins/winter/user/models/User.php
public $rules = [
'email' => 'required|between:6,255|email|unique:users',
...
];
but this should not ever happen because even though the user already exists and the e-mail is already taken, the e-mail can still be used to register the guest and claim the account in the process.
The text was updated successfully, but these errors were encountered:
AIC-BV
added a commit
to AIC-BV/wn-user-plugin
that referenced
this issue
Feb 3, 2023
As discussed on Discord with @mjauvin, guest users are currently not working.
I create a guest (documentation)
Assuming onCheckEmail is not an official part of the plugin but just an example; this can be ignored
I adjusted example the onCheckEmail() function becauseAuth::findUserByLogin
returns TRUE if a user is found regardless of its valueuser->is_guest
. In my case (and everyone elses?), it should also return FALSE ifuser->is_guest
because even though the user already exists, the user with that specific e-mailadress is still available to be claimed by anyone.I adjusted the function to solve this issue (which is not really an issue but not documented I guess).
This brings me to the next issue;When the guest user finally wants to register, he gets a validation error that the e-mailadress is already in use because:
Which contains
but this should not ever happen because even though the user already exists and the e-mail is already taken, the e-mail can still be used to register the guest and claim the account in the process.
The text was updated successfully, but these errors were encountered: