Skip to content

Commit

Permalink
Merge pull request #212 from ontoportal-lirmm/fix/signup-fields-valid…
Browse files Browse the repository at this point in the history
…ation

Fix: Signup page input fields validation
  • Loading branch information
syphax-bouazzouni authored Mar 10, 2023
2 parents b18b0ed + 15058ac commit be01df0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,13 @@ def validate(params)
errors << "Please fill in the proper text from the supplied image"
end
end
if ((!params[:orcidId].match(/^\d{4}+(-\d{4})+$/)) || (params[:orcidId].length != 19)) && !(params[:orcidId].nil? || params[:orcidId].length < 1)
errors << "Please enter a valide orcid id"
end

if params[:username].nil? || params[:username].length < 1 || !params[:username].match(/^[a-zA-Z0-9]([._-](?![._-])|[a-zA-Z0-9]){3,18}[a-zA-Z0-9]$/)
errors << "please enter a valid username"
end
return errors
end

Expand Down

0 comments on commit be01df0

Please sign in to comment.