mirror of https://github.com/Siphonay/mastodon
requested changes & style cleanup
This commit is contained in:
parent
3d9f99a883
commit
acb23ef2bc
|
@ -21,14 +21,17 @@ class Api::V1::AccountsController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
not_found
|
if ENV['HCAPTCHA_ENABLED'] == 'true'
|
||||||
# token = AppSignUpService.new.call(doorkeeper_token.application, account_params)
|
not_found
|
||||||
# response = Doorkeeper::OAuth::TokenResponse.new(token)
|
else
|
||||||
|
token = AppSignUpService.new.call(doorkeeper_token.application, account_params)
|
||||||
|
response = Doorkeeper::OAuth::TokenResponse.new(token)
|
||||||
|
|
||||||
# headers.merge!(response.headers)
|
headers.merge!(response.headers)
|
||||||
|
|
||||||
# self.response_body = Oj.dump(response.body)
|
self.response_body = Oj.dump(response.body)
|
||||||
# self.status = response.status
|
self.status = response.status
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def follow
|
def follow
|
||||||
|
|
|
@ -96,10 +96,10 @@ class Auth::RegistrationsController < Devise::RegistrationsController
|
||||||
|
|
||||||
def check_captcha
|
def check_captcha
|
||||||
if ENV['HCAPTCHA_ENABLED'] == 'true' && !verify_hcaptcha
|
if ENV['HCAPTCHA_ENABLED'] == 'true' && !verify_hcaptcha
|
||||||
self.resource = resource_class.new sign_up_params
|
build_resource(sign_up_params)
|
||||||
resource.validate
|
resource.validate
|
||||||
flash[:alert] = Hcaptcha::Helpers.to_error_message(:verification_failed)
|
resource.errors.add(:base, flash.delete(:hcaptcha_error))
|
||||||
respond_with_navigational(resource) { render :new }
|
respond_with resource
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -148,5 +148,4 @@ module ApplicationHelper
|
||||||
json = ActiveModelSerializers::SerializableResource.new(InitialStatePresenter.new(state_params), serializer: InitialStateSerializer).to_json
|
json = ActiveModelSerializers::SerializableResource.new(InitialStatePresenter.new(state_params), serializer: InitialStateSerializer).to_json
|
||||||
content_tag(:script, json_escape(json).html_safe, id: 'initial-state', type: 'application/json')
|
content_tag(:script, json_escape(json).html_safe, id: 'initial-state', type: 'application/json')
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,7 +16,7 @@ if Rails.env.production?
|
||||||
attachments_host = nil
|
attachments_host = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
hcaptcha_hosts = ["https://hcaptcha.com", "https://*.hcaptcha.com"]
|
hcaptcha_hosts = ENV['HCAPTCHA_ENABLED'] == 'true' ? ["https://hcaptcha.com", "https://*.hcaptcha.com"] : nil
|
||||||
|
|
||||||
data_hosts << attachments_host unless attachments_host.nil?
|
data_hosts << attachments_host unless attachments_host.nil?
|
||||||
|
|
||||||
|
|
|
@ -543,8 +543,6 @@ en:
|
||||||
deletion:
|
deletion:
|
||||||
desc_html: Allow anyone to delete their account
|
desc_html: Allow anyone to delete their account
|
||||||
title: Open account deletion
|
title: Open account deletion
|
||||||
errors:
|
|
||||||
captcha_fail: Captcha verification failed
|
|
||||||
min_invite_role:
|
min_invite_role:
|
||||||
disabled: No one
|
disabled: No one
|
||||||
title: Allow invitations by
|
title: Allow invitations by
|
||||||
|
|
Loading…
Reference in New Issue