module Pathway::Plugins::SimpleAuth::InstanceMethods

Public Instance Methods

authorize(state, using: nil) click to toggle source
# File lib/pathway/plugins/simple_auth.rb, line 15
def authorize(state, using: nil)
  auth_state = if using.is_a?(Array)
                 authorize_with(*state.values_at(*using))
               else
                 authorize_with(state[using || result_key])
               end

  auth_state.then { state }
end
authorize_with(*objs) click to toggle source
# File lib/pathway/plugins/simple_auth.rb, line 25
def authorize_with(*objs)
  authorized?(*objs) ? wrap(objs) : error(:forbidden)
end
authorized?(*) click to toggle source
# File lib/pathway/plugins/simple_auth.rb, line 29
def authorized?(*)
  true
end