Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SessionsController::new should pass optional return_to parameter on to SessionsController::create #78

Closed
rnewman57 opened this issue Feb 25, 2010 · 4 comments
Labels

Comments

@rnewman57
Copy link

The SessionController::new method (sign_in link) should take an optional return_to parameter and pass it on to SessionController::create via a hidden form field. With this change, a user can click on a "Login" link from any page of the application, log in, and be automatically returned to whatever page she was originally on.

SessionController::destroy should also take an optional return_to parameter and redirect to it, so that a logged-in user can click on a "Logout" link from any page, and be automatically returned to that page as a logged-out users. (See also http://github.com/thoughtbot/clearance/issues/23 )

I committed a fix to this to my fork at
http://github.com/rnewman57/clearance/commit/57bba85dc63ba7f0ae7a138743ab228afb994ac6

This fork and issue are inspired by this conversation in the Clearance Google Group:
http://groups.google.com/group/thoughtbot-clearance/browse_thread/thread/b2da1c06fdb503c7#

@croaky
Copy link
Contributor

croaky commented Feb 26, 2010

The new commit looks good to me.

@rnewman57
Copy link
Author

My new commit that fixes this without a hidden form field is here:

http://github.com/rnewman57/clearance/commit/a4d19ec27479887f978a429130fd10bc74a52268

This commit also incorporates my previous fixes for issues #77 and #23 .

@rnewman57
Copy link
Author

Applying this diff to the current version of Clearance will fix and test this issue (and also #23) :

http://gist.github.com/390853

@croaky
Copy link
Contributor

croaky commented Apr 30, 2011

Closing this one due to old age. We haven't needed this functionality in any of our apps, so we take that as a sign that this isn't necessary right now.

@croaky croaky closed this as completed Apr 30, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants