Module: Passport::Certification::ClassMethods
- Defined in:
- lib/passport/core/certification.rb
Instance Method Summary collapse
- #approve(user = nil) ⇒ Object (also: #complete)
- #approve? ⇒ Boolean (also: #complete?)
- #authenticate(user = nil, &block) ⇒ Object
- #process(user = nil) ⇒ Object (also: #start)
- #process? ⇒ Boolean (also: #start?)
- #protocol ⇒ Object
Instance Method Details
#approve(user = nil) ⇒ Object Also known as: complete
23 24 25 |
# File 'lib/passport/core/certification.rb', line 23 def approve(user = nil) protocol.approve(user) if protocol end |
#approve? ⇒ Boolean Also known as: complete?
18 19 20 |
# File 'lib/passport/core/certification.rb', line 18 def approve? Passport::Oauth::Protocol.response? # || Passport::OpenId::Protocol.complete? end |
#authenticate(user = nil, &block) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/passport/core/certification.rb', line 28 def authenticate(user = nil, &block) if process? process(user) # redirect to service elsif approve? token = approve(user) yield(token) if block_given? token end end |
#process(user = nil) ⇒ Object Also known as: start
13 14 15 |
# File 'lib/passport/core/certification.rb', line 13 def process(user = nil) protocol.process(user) if protocol end |