Module: Pathway::Plugins::SimpleAuth::InstanceMethods

Defined in:
lib/pathway/plugins/simple_auth.rb

Instance Method Summary collapse

Instance Method Details

#authorize(state, using: nil) ⇒ Object



13
14
15
# File 'lib/pathway/plugins/simple_auth.rb', line 13

def authorize(state, using: nil)
  authorize_with(state[using || result_key]).then { state }
end

#authorize_with(*objs) ⇒ Object



17
18
19
20
# File 'lib/pathway/plugins/simple_auth.rb', line 17

def authorize_with(*objs)
  objs = objs.first if objs.size <= 1
  authorized?(*objs) ? wrap(objs) : error(:forbidden)
end

#authorized?(*_) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/pathway/plugins/simple_auth.rb', line 22

def authorized?(*_)
  true
end