Module: Passport::Oauth::State::ClassMethods

Defined in:
lib/passport/oauth/protocol/state.rb

Instance Method Summary collapse

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/passport/oauth/protocol/state.rb', line 20

def active?
  request? || response?
end

#auto_register?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/passport/oauth/protocol/state.rb', line 36

def auto_register?
  true
end

#params?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/passport/oauth/protocol/state.rb', line 24

def params?
  super && key?(:oauth_provider)
end

#provider?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/passport/oauth/protocol/state.rb', line 32

def provider?
  !provider.blank?
end

#request?Boolean Also known as: start?

Returns:

  • (Boolean)


10
11
12
# File 'lib/passport/oauth/protocol/state.rb', line 10

def request?
  params? && provider? && !response?
end

#response?Boolean Also known as: complete?

Returns:

  • (Boolean)


15
16
17
# File 'lib/passport/oauth/protocol/state.rb', line 15

def response?
  params? && session? && token?
end

#token?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/passport/oauth/protocol/state.rb', line 28

def token?
  provider? && !token.blank?
end