forked from e621ng/e621ng
[Login] Add captcha to login page.
This commit is contained in:
parent
a8276c4775
commit
d532cd28c5
@ -4,6 +4,9 @@ class SessionsController < ApplicationController
|
||||
end
|
||||
|
||||
def create
|
||||
if !verify_recaptcha()
|
||||
return redirect_to(new_session_path, :notice => "Username/Password was incorrect")
|
||||
end
|
||||
session_creator = SessionCreator.new(session, cookies, params[:name], params[:password], request.remote_ip, params[:remember], request.ssl?)
|
||||
|
||||
if session_creator.authenticate
|
||||
|
@ -20,6 +20,10 @@
|
||||
<label for="remember" id="remember-label">Remember</label>
|
||||
</div>
|
||||
|
||||
<% if Danbooru.config.enable_recaptcha? %>
|
||||
<%= recaptcha_tags theme: 'dark', nonce: content_security_policy_nonce %>
|
||||
<% end %>
|
||||
|
||||
<div class="input">
|
||||
<%= submit_tag "Submit", :data => { :disable_with => "Signing in..." } %>
|
||||
</div>
|
||||
|
@ -21,9 +21,7 @@
|
||||
|
||||
<%= f.input :time_zone, :include_blank => false %>
|
||||
|
||||
<% if Danbooru.config.enable_recaptcha? %>
|
||||
<%= recaptcha_tags theme: 'dark', nonce: content_security_policy_nonce %>
|
||||
<% end %>
|
||||
<%= recaptcha_tags theme: 'dark', nonce: content_security_policy_nonce %>
|
||||
<%= f.submit "Sign up", :data => { :disable_with => "Signing up..." } %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
@ -61,4 +61,6 @@ Rails.application.configure do
|
||||
|
||||
# Uncomment if you wish to allow Action Cable access from any origin.
|
||||
# config.action_cable.disable_request_forgery_protection = true
|
||||
|
||||
config.hosts << 'e621ng.local'
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user