Please sign in to comment.
Add `redirect_url` config option
* Clarify in README that the config example shows the default values. * Wrap long line at 80 characters. * Move `redirect_to_root` from `lib/clearance/authorization.rb` to where it is used, in `app/controllers/clearance/sessions_controller.rb`, and better reveal its intent by re-naming it to `avoid_sign_in`. * Re-set `config.secure_cookie` to its original value in an `after` block in a test to teardown and avoid leakage across tests. * Use `_url` suffix in config name to match [RFC 2616 spec, section 14. 14.30](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30), which states the Location response-header field should use an absolute URI for 3xx responses. * The default value for `redirect_url` is the string path `'/'` as a previous compromise to make it less likely users will run into an issue if they don't want to define a root route. The string value avoids potentially confusing `NoMethodError: undefined method 'root_url'` errors. #281
- Loading branch information...
Showing with 49 additions and 13 deletions.
- +2 −1 README.md
- +3 −2 app/controllers/clearance/passwords_controller.rb
- +1 −1 app/controllers/clearance/sessions_controller.rb
- +6 −2 app/controllers/clearance/users_controller.rb
- +1 −5 lib/clearance/authorization.rb
- +2 −0 lib/clearance/configuration.rb
- +32 −0 spec/configuration_spec.rb
- +2 −2 spec/controllers/users_controller_spec.rb