Developer forum

Forum » Development » New email subscriber registered, cannot create new user with same email/username.

New email subscriber registered, cannot create new user with same email/username.

Dmitrij Jazel
Reply

Hi Guys,

When user subscribes to newsletter. New user is created with random password, and placed into Newsletter user group. - all ok here.

There are 2 seperate user groups. One is Newsletter subscribers only, another one is Extranet/Website users.

 

At the same time, someone decides to register a new user, but he can't cause I am getting

UserManagement:User.UserName.Input.Error This username is already taken

Error

Any way to by-pass this?

 

it would be great if the user with the same email gets registered, than his information is used as actual user information (email, name, password etc...)

And user is located in 2 groups. Because he is Newsletter subscriber, AND Website user now.


Replies

 
Dmitrij Jazel
Reply

Ahh, just noticed, this error pops up because we are using email as username.

Than in order to solve this, I think it should be possible to alter before user created event, adjust args for to create a random username if new email subscriber is created.

 

What event would you recomend for this?

 
Nicolai Pedersen
Reply

You could offer a "recover password" feature like any other website on earth with profiles.

Also 8.9 gets a new feature so you can create a new profile even if you have one already. Makes no sense, but I keep getting this question :-)

BR Nicolai

 
Dmitrij Jazel
Reply

Yes, every website uses it, and I love how it was implemented so far. :-)

One who made "send link to reset password" nas our big thanks!

 

Not sure if you understood me correctly Nicolai,

Here is what is happening.

1) Someone with email jonas@test.no subscribes to newsletter - as a result new user is created where Username is "jonas@test.no" and random password.

Keep in mind that emai is also username.

2) After a while, same person, decides to create a user on website. He uses email "jonas@test.no" but he is not allowed.

Bcause there is already a user with this username (because email is used as username). Hope this makes it more clear.

 

Do you really think Remind me password could be solution for this?

 
Nicolai Pedersen
Reply

Well yes, simply saying "dude, you already have an account". Or fill the username with gibberish when they signup for the newsletter.

But wait one more week and you can create an account on top of an existing account with 8.9

 
Dmitrij Jazel
Reply

Hi Nicolai,

Yes, this helped. A bit.

As a result, now we have 2 users. 

But here is another situation.

Since 1 user is Newsletter subscriber and his name now is "RandomDude" with email "jonas@test.no".

Jonas than registers his user on website. with Username "Jonas" and email "jonas@test.no". Now system creates separate user in another userGroup. Fine - let it be for now.

 

Time goes by, and Jonas forgets his password.

He than attempts to use "remind me password" feature. And enters his Email.

 

Question:

What will happen? Will Jonas get an email, or will system attempt to send email to "RandomDude" user, and so Jonas will change password for his EmailSubscriber account instead of Real user account!?

 

The reason why I am asking:

We had a situation when solution was to "duplicate user instance". basically we just had simmilar structure. Same email, different usernames. As a result, we had to fix this, because users where not able to change their users password, but instead changed passwords of their duplicates, that they where not supposed to reach!

 

Hope this is clear enough, and you understand what is the problem here.

 

But still appreciate your answer so far, cause we got 1 step further.

 

8.9 is nice, but again, would it really help? cause ducplicating same user - means actual problem.

 

Suggestion:

To write some custom code that alters user registration process, and merges users when 1 decodes to create a real account.

For that I would need an event.

 

 
Nicolai Pedersen
Reply

The real solution is to have the user only once, and if they exist, just tell it to the user and let them restore the password.

With 8.9 you can create a profile on top of an existing user - it works by "merging" the new and old user based on email address so you get only one record.

 
Dmitrij Jazel
Reply

Hi Nicolai,

Any hints on when we can expect 8.9 to be available?

/Dmitrij

 
Nicolai Pedersen
Reply

8.9 is released tomorrow.

 
Dmitrij Jazel
Reply

Allright,

Application updated to 8.9

Did exactly the same thing, and still getting username already taken error.

Is there some checkbox I have to enable, or something like that?

 
Nicolai Pedersen
 
Arker Soe
Arker Soe
Reply

Hi Nicolai,

I have read this thread.

what I want is that 

UserManagement:User.UserName.Input.Error This username is already taken

when existing email address in user list is used to register.

My site use email address for user name and user email.

But for some reason, I never get the error message and got new user created even though the email address is duplicated.

Then for that reason, i got another sisue with recovering forget password process.

I am using dw 9.1.4

i am using the wrap template(default) for the form.

any suggestion?

 

 
Asdis Gudmundsdottir
Asdis Gudmundsdottir
Reply

Having the exact same issue. 

Did you find a solution to the problem?

 

 
Nicolai Pedersen
Reply

Hi Asdis

This thread mentions a couple of things. Can you ellaborate on your issue? 

 
Asdis Gudmundsdottir
Asdis Gudmundsdottir
Reply

Hi Nicolai, thanks for answering this quickly.

If a user is already in the group "email subscriptions" when he wants to sign up as regular user, then he is either duplicated and can't reset his password or the system won't have two users with the same email address.

Would be nice to have seperated list for email subscriptions only so it's not mixed with Extranet users.

We tried to workaround it by saving the email as username, both for subscriptions and sign up, and if an email address already exists on "sign up" we redirect to "reset password" page, but then the user is not put in the correct group.

Is there a way to add to group manually in code? 

In my opinion its too many steps and complicated for new users to sign up (sign up - redirect - forgot password - email - new password - login) 

This is however the best solution we found so far. 

Thanks in advance, 

Ásdís

 

 
Nicolai Pedersen
Reply

Hi Asdis

I belive the "Update existing users based on email match" checkbox does that - overwrites an existing user if it exists. See dump.

The entire idea is NOT to have seperate lists for users and emails. That is why both is in the same database - in old days it was 2 different databases. It should be possible to create a nice flow for users that are doing both - since newsletter signup is basically just a consent, member of a group or a property of a user - all part of the users profile.

BR Nicolai

Capture.PNG
 
Asdis Gudmundsdottir
Asdis Gudmundsdottir
Reply

I already tried that option, but only with our "old" form using @GetString("UserManagement:User.FormStart"). 
After replacing with regular form like Rapido and trying that option again, it works! 

Thank you so much :) 

Ásdís

 

You must be logged in to post in the forum