Class: OmniAuth::Strategies::Lightning
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::Lightning
- Includes:
- OmniAuth::Strategy
- Defined in:
- lib/omniauth/strategies/lightning.rb
Instance Method Summary collapse
Instance Method Details
#callback_phase ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/omniauth/strategies/lightning.rb', line 44 def callback_phase r = validate_invoice!(request['invoice']) if r == :ok super else return fail!(*r) end end |
#request_phase ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/omniauth/strategies/lightning.rb', line 25 def request_phase if [:on_login] [:on_login].call(self.env) else OmniAuth::Form.build( title: ([:title]), url: callback_path ) do |f| f.html """ <p> Create an invoice for #{[:invoice_sats_amount]} satoshis that starts with \"#{[:validating_text]}\". </p> """ f.text_field 'Invoice', 'invoice' end.to_response end end |