Class: ActionAuth::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/action_auth/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/action_auth/configuration.rb', line 17

def initialize
  @allow_user_deletion = true
  @default_from_email = "[email protected]"
  @magic_link_enabled = true
  @passkey_only = true
  @pwned_enabled = defined?(Pwned)
  @sms_auth_enabled = false
  @sms_send_class = nil
  @verify_email_on_sign_in = true
  @webauthn_enabled = defined?(WebAuthn)
  @webauthn_origin = "http://localhost:3000"
  @webauthn_rp_name = Rails.application.class.to_s.deconstantize
end

Instance Attribute Details

#allow_user_deletionObject

Returns the value of attribute allow_user_deletion.



4
5
6
# File 'lib/action_auth/configuration.rb', line 4

def allow_user_deletion
  @allow_user_deletion
end

#default_from_emailObject

Returns the value of attribute default_from_email.



5
6
7
# File 'lib/action_auth/configuration.rb', line 5

def default_from_email
  @default_from_email
end

Returns the value of attribute magic_link_enabled.



6
7
8
# File 'lib/action_auth/configuration.rb', line 6

def magic_link_enabled
  @magic_link_enabled
end

#passkey_onlyObject

Returns the value of attribute passkey_only.



7
8
9
# File 'lib/action_auth/configuration.rb', line 7

def passkey_only
  @passkey_only
end

#pwned_enabledObject

Returns the value of attribute pwned_enabled.



8
9
10
# File 'lib/action_auth/configuration.rb', line 8

def pwned_enabled
  @pwned_enabled
end

#sms_auth_enabledObject

Returns the value of attribute sms_auth_enabled.



9
10
11
# File 'lib/action_auth/configuration.rb', line 9

def sms_auth_enabled
  @sms_auth_enabled
end

#sms_send_classObject

Returns the value of attribute sms_send_class.



10
11
12
# File 'lib/action_auth/configuration.rb', line 10

def sms_send_class
  @sms_send_class
end

#verify_email_on_sign_inObject

Returns the value of attribute verify_email_on_sign_in.



11
12
13
# File 'lib/action_auth/configuration.rb', line 11

def 
  @verify_email_on_sign_in
end

#webauthn_enabledObject

Returns the value of attribute webauthn_enabled.



12
13
14
# File 'lib/action_auth/configuration.rb', line 12

def webauthn_enabled
  @webauthn_enabled
end

#webauthn_originObject

Returns the value of attribute webauthn_origin.



13
14
15
# File 'lib/action_auth/configuration.rb', line 13

def webauthn_origin
  @webauthn_origin
end

#webauthn_rp_nameObject

Returns the value of attribute webauthn_rp_name.



14
15
16
# File 'lib/action_auth/configuration.rb', line 14

def webauthn_rp_name
  @webauthn_rp_name
end

Instance Method Details

#allow_user_deletion?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/action_auth/configuration.rb', line 31

def allow_user_deletion?
  @allow_user_deletion == true
end

Returns:

  • (Boolean)


35
36
37
# File 'lib/action_auth/configuration.rb', line 35

def magic_link_enabled?
  @magic_link_enabled == true
end

#passkey_only?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/action_auth/configuration.rb', line 43

def passkey_only?
  webauthn_enabled? && @passkey_only == true
end

#pwned_enabled?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/action_auth/configuration.rb', line 51

def pwned_enabled?
  @pwned_enabled.respond_to?(:call) ? @pwned_enabled.call : @pwned_enabled
end

#sms_auth_enabled?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/action_auth/configuration.rb', line 39

def sms_auth_enabled?
  @sms_auth_enabled == true
end

#webauthn_enabled?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/action_auth/configuration.rb', line 47

def webauthn_enabled?
  @webauthn_enabled.respond_to?(:call) ? @webauthn_enabled.call : @webauthn_enabled
end