Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Problem with redirects during login #501

Closed
ghost opened this issue Nov 18, 2010 · 2 comments
Closed

Problem with redirects during login #501

ghost opened this issue Nov 18, 2010 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 18, 2010

Background:

  • Using Ruby on Rails 3 with Devise for authentication.
  • All pages (except sign-in, sign-up, etc) are behind authentication
  • My "home" page contains multiple jQuery Mobile "pages".

Problem:

When the user tries to visit the root / home, they get redirected to login. After the user authenticates, they are redirected back to the root url. The redirect doesn't work as expected and they end up on the wrong page with the wrong url.

Example Flow:

This last redirect is wrong. When the home page has multiple jQuery Mobile pages (as mine does) the last page is incorrectly displayed.

After forcibly changing the URL to the desired root (http://mydomain.com/), the application then works fine.

Request

  • Allow some URLs (like for login, sign up, etc) to not be fetched with AJAX but treated like a rel='external'.
  • Or provide some other means of handling this scenario.
  • Or provide an example of how to deal with or workaround the issue.

This problem doesn't seem to be unique to jQuery Mobile, but a problem with AJAX requests and redirects. I found lot of people with the same problems and no good applicable solutions. Any help is appreciated.

PS> The jQuery Mobile forum has several questions about this issue too. We may just need some guidance.

@ghost
Copy link
Author

ghost commented Nov 18, 2010

For my Rails needs, I got a solid working solution. My write up is here: http://forum.jquery.com/topic/login-problems-with-redirects

@Korayem
Copy link

Korayem commented Dec 25, 2011

For forms just set "data-ajax" attribute to false.

It should be like this:

<form action="postthis" method="post" data-ajax="false">

This will disable default ajax handling of jQuery mobile
Reference: http://jquerymobile.com/test/docs/forms/forms-sample.html

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant