Skip to content

Commit

Permalink
Added configuration option for default email
Browse files Browse the repository at this point in the history
  • Loading branch information
kobaltz committed Jan 22, 2024
1 parent ecb0e7d commit a35e928
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ ActionAuth.configure do |config|
config.webauthn_origin = "http://localhost:3000" # or "https://example.com"
config.webauthn_rp_name = Rails.application.class.to_s.deconstantize
config.verify_email_on_sign_in = true
config.default_from_email = "[email protected]"
end
```
Expand Down Expand Up @@ -200,6 +201,7 @@ ActionAuth.configure do |config|
config.webauthn_origin = "http://localhost:3000" # or "https://example.com"
config.webauthn_rp_name = Rails.application.class.to_s.deconstantize
config.verify_email_on_sign_in = true
config.default_from_email = "[email protected]"
end
```
Expand Down
1 change: 1 addition & 0 deletions app/mailers/action_auth/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module ActionAuth
class ApplicationMailer < ActionMailer::Base
default from: ActionAuth.configuration.default_from_email
layout "mailer"
end
end
2 changes: 2 additions & 0 deletions lib/action_auth/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ class Configuration
attr_accessor :webauthn_origin
attr_accessor :webauthn_rp_name
attr_accessor :verify_email_on_sign_in
attr_accessor :default_from_email

def initialize
@webauthn_enabled = defined?(WebAuthn)
@webauthn_origin = "http://localhost:3000"
@webauthn_rp_name = Rails.application.class.to_s.deconstantize
@verify_email_on_sign_in = true
@default_from_email = "[email protected]"
end

def webauthn_enabled?
Expand Down

0 comments on commit a35e928

Please sign in to comment.