Make recaptcha optional on signup page.
This commit is contained in:
@@ -44,7 +44,7 @@ class UsersController < ApplicationController
|
||||
def create
|
||||
@user = User.new(params[:user], :as => CurrentUser.role)
|
||||
@user.last_ip_addr = request.remote_ip
|
||||
if verify_recaptcha(model: @user)
|
||||
if !Danbooru.config.enable_recaptcha? || verify_recaptcha(model: @user)
|
||||
@user.save
|
||||
if @user.errors.empty?
|
||||
session[:user_id] = @user.id
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
<%= f.input :password %>
|
||||
<%= f.input :password_confirmation %>
|
||||
|
||||
<%= invisible_recaptcha_tags callback: 'submitInvisibleRecaptchaForm', text: 'Sign up' %>
|
||||
<% if Danbooru.config.enable_recaptcha? %>
|
||||
<%= invisible_recaptcha_tags callback: 'submitInvisibleRecaptchaForm', text: 'Sign up' %>
|
||||
<% else %>
|
||||
<%= f.submit "Sign up", :data => { :disable_with => "Signing up..." } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user