5
6
7
8
9
10
11
12
13
14
|
# File 'lib/devise_sms_verifiable/controllers/internal_helpers.rb', line 5
def sms_check_settings!
if public_send("current_#{Devise::default_scope}").nil?
public_send(:redirect_to, %I[new #{Devise::default_scope} session]) and return
end
raise PhoneFieldNotFound unless public_send("current_#{Devise::default_scope}").respond_to?(Devise::phone_field)
raise PhoneFieldEmpty unless public_send("current_#{Devise::default_scope}").public_send(Devise::phone_field)
raise ValidSendSmsMethodNotFound unless InternalHelpers::valid_method?(Devise::sms_provider, :send_sms)
rescue DeviseSmsVerifiableError, ArgumentError
raise "DeviseSmsVerifiableError module error: #{$!.message} "
end
|