codingdir logo sitemap sitemap |
Home
PHP
C#
C++
ANDROID
JAVA
JAVASCRIPT
PYTHON

Login to a site without redirect to that site using jQuery/ajax


By : , Category : javascript

I'd suggest watching your network traffic in something like Fiddler, Firebug, or Chrome's developer tools and see what the response is that is causing the error. I'm guessing your placeholderurl is on a different domain and your call is failing due to that.

ReLated :

Try replacing the contents inside the <authentication mode="Forms"></authentication> block with:

<forms loginUrl="~/loginpage.aspx" defaultUrl="Default.aspx" name="OpenIdProviderWebForms" timeout="2880" />

Replace the "loginUrl" attribute with the correct place to where your login page resides.

At the place where you create the url to do the redirect append the return parameter to it. Something along the lines should work:

$return = base64_encode(JURI::getInstance(
              JFactory::getURI()->toString(array('path', 'query', 'fragment'))
          ));
JFactory::getApplication()->redirect(
    JRoute::_('index.php?option=com_users&view=login&return=' . $return, true, true)
);

Web servers, in this case Django, do not see the fragment after the #. You are redirecting from / to /, creating a redirect loop.

If you want to redirect to the Django login url, you need login_url='/login'.

As an aside, you should remove the leading slash from your regex r'^/login$.

LoggingInEvent is raised before the user is authenticated. So the first part of your condition is always false. Move you logics under LoggedIn event. Try this one:

protected void baseLogin1_LoggedIn(object sender, EventArgs e)
{
    if (Context.User.Identity.IsAuthenticated && Context.User.IsInRole("Admin"))
    {
        Context.Response.Redirect("admin/Default.aspx");
    }
}
Comments


Message :
Login to Add Your Comments .
How to disable registered OpenCL platforms on Windows?
Is Observable broken in Angular 2 Beta 3?
Cross-thread operation not valid when using Invoke
How to pass an IEnumerable or queryable list of properties from Controller to View
Finding numbers after a certain keyword using Python
Pocketsphinx recognizes random phrases in a silence
Passing non-thread-safe objects through thread-safe containers
React scroll nav
BizTalk WCF-BasicHttp Adapter does not allow Empty string for Service Certificate Props
Why property ''cause" of Exception is repeating forever?
Privacy Policy 2017 © codingdir.com All Rights Reserved .