Check for duplicate e-mail before allowing sign up on Confluence

We are having some users forget they have accounts and create another account using their same e-mail address. This results in two users on Confluence with the same e-mail. We would expect that Confluence would check if the e-mail is already in use before allowing creation of another account. Is it possible to add this checking via any code added into the Velocity template or via a plug-in?

2 answers

I have found UserAccessor.getUsersByEmail and tried the following but it does not work and pager().isEmpty() returns true every time even if an already registered e-mail address is passed to it. Does anyone know of another method that can be used from within the Velocity context similar to UserAccessor.getUsersByEmail that is working?

function validateform() {
emailtocheck = document.signupform.email.value;
if($userAccessor.getUsersByEmail(emailtocheck).pager().isEmpty()) {
return true;
} else {
alert ('ERROR: A user with this e-mail address is already registered. If you think you already may have an account please try to recover your password using the Forgot Password tool instead.');
return false;
}

<form ... onsubmit="return validateform()">

Same question. Would be interesting to know. How to handle $userAccessor.getUsersByEmail()?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

364 views 20 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you