How to retrieve user name


(Fiona) #1

Hi there,

 

Currently when creating new users through the account manager.. a person needs to enter a username, email and password.

 

If that person then forgets what username they entered, how do they go about retrieving the username? There is a a retrieve password asset, but this requires the person to enter their username.

 

From my experience people sometimes forget their username but are likely to remember their email address.. so is there a way for people to retrieve their username by entering their email address? I could not find a way to do this...

 

If it is not possible then I have contemplated making the username their email address by using the email address for both.. but I haven't been able to set this up either as yet. Hoping the above might be possible before I go down this path?

 

BTW this is for public users.

 

Thanks

 

 

 

 


(Bart Banda) #2

You could potentially have search page where the search field is targeting user emails and then the results page could run a trigger maybe to send that user an email with their username.

 

The problem with that is allowing public searches on users.

 

ANother way to do it is to use a custom form that fires a trigger that then does the search via a REST asset, and then run some server side JS to grab the username and then fire another trigger action to send the email. You don't actually need a custom form asset to fire the trigger, just a page on the front end that can make a POST call and fire the trigger. With a custom form you could utilise the captcha feature as well though. 


(Fiona) #3

Thanks Bart, I agree about the first option being a security risk. The second option sounds like it would work but is a bit complex for me.. and I noticed that the email field for a user does not have to be unique, so it could be that somebody has a couple of accounts using the same email which gets a bit messy.

 

I think I'll stick with the way it is and try to enforce people use an email address as their username... perhaps Squiz could implement this ability down the track as I would imagine it would be expected when dealing with public users.

 

Cheers


(Bart Banda) #4

I think I'll stick with the way it is and try to enforce people use an email address as their username... perhaps Squiz could implement this ability down the track as I would imagine it would be expected when dealing with public users.

 

Yea perhaps, but you would still run into the same problem you mentioned where the email address might be the same for multiple users. I guess in those instances you could always say that a unique user could not be found and those users would have to contact the site owners to get their username, would be a very small minority of users though. Using email address as your username is ideal.