harvard-dce / dce_lti

An engine to simplify LTI Authentication for rails applications
MIT License
13 stars 4 forks source link

Redirect after session expire #15

Closed benjaminwols closed 8 years ago

benjaminwols commented 8 years ago

I made this PR to customise the redirect after session expire. The default stays the same to invalid_session_path, but it is now possible to set your own route in the config.

djcp commented 8 years ago

Great! Can you look through dce_lti/spec/controllers/dce_lti/sessions_controller_spec.rb for examples (and probably other spec files) and think of a test for this feature?

benjaminwols commented 8 years ago

I will look at the test later this week.

benjaminwols commented 8 years ago

I added a test for the redirect_after_session_expired. The test is based on 'redirects to "redirect_after_successful_auth" url when it is a proc' in sessions_controller_spec, but I put the test in posts_controller_spec, because I wanted to request posts index without a valid lti session, which than should redirect me to the url specified in the redirect_after_session_expire proc.

I fixed some deprecation warnings while adding a test.

Please let me know what you think of the test.

djcp commented 8 years ago

This looks good - can you squash your commits, I'll give it one last look and merge? Thanks so much!

benjaminwols commented 8 years ago

I squashed the commits.

djcp commented 8 years ago

Thanks! I'm going to look at this (along with the newly activerecord_session-store release) and merge soon. You're a champ!