You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cartodb/app/helpers/signup_helper.rb

27 lines
761 B

module SignupHelper
def duplicated_username_prompt?
# Ask for a different username for Google or GitHub signups with username errors
only_username_errors? && (google_sign_in? || github_sign_in?)
end
def only_username_errors?
errors = @user.try(:errors)
return false unless errors.present?
@user.errors.select { |_, v| v.present? }.keys == [:username]
end
def google_sign_in?
@user.google_sign_in && @organization.auth_google_enabled
end
def github_sign_in?
@user.github_user_id && @organization.auth_github_enabled
end
6 years ago
def organization_signup_url
subdomain = CartoDB.subdomain_from_request(request)
CartoDB.base_url(subdomain) + signup_path if Carto::Organization.where(name: subdomain).any?
end
end