Module: RapidRack::DefaultReceiver
- Defined in:
- lib/rapid_rack/default_receiver.rb
Instance Method Summary collapse
- #finish(_env) ⇒ Object
- #logout(env) ⇒ Object
- #map_attributes(_env, attrs) ⇒ Object
- #receive(env, claims) ⇒ Object
- #redirect_to(url) ⇒ Object
- #store_id(env, id) ⇒ Object
Instance Method Details
#finish(_env) ⇒ Object
17 18 19 |
# File 'lib/rapid_rack/default_receiver.rb', line 17 def finish(_env) redirect_to('/') end |
#logout(env) ⇒ Object
25 26 27 28 |
# File 'lib/rapid_rack/default_receiver.rb', line 25 def logout(env) env['rack.session'].destroy redirect_to('/') end |
#map_attributes(_env, attrs) ⇒ Object
9 10 11 |
# File 'lib/rapid_rack/default_receiver.rb', line 9 def map_attributes(_env, attrs) attrs end |
#receive(env, claims) ⇒ Object
3 4 5 6 7 |
# File 'lib/rapid_rack/default_receiver.rb', line 3 def receive(env, claims) attrs = map_attributes(env, claims['https://aaf.edu.au/attributes']) store_id(env, subject(env, attrs).id) finish(env) end |
#redirect_to(url) ⇒ Object
21 22 23 |
# File 'lib/rapid_rack/default_receiver.rb', line 21 def redirect_to(url) [302, { 'Location' => url }, []] end |
#store_id(env, id) ⇒ Object
13 14 15 |
# File 'lib/rapid_rack/default_receiver.rb', line 13 def store_id(env, id) env['rack.session']['subject_id'] = id end |