Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

using Sys.Services.AuthenticationService.login and Decoding url in Javascript

Back to Forum: Tech Off
  • User profile image
    foreachdev

    So I have the following code using JQUERY with Sys.Services.AuthenticationService.login.

    var username = $('#username').attr("value");

    var password = $('#password').attr("value");

    var isPersistent = false;

    var customInfo = null;

    var redirectUrl = $.jqURL.get('ReturnUrl');

    Sys.Services.AuthenticationService.login(

    username,

    password,

    isPersistent,

    customInfo,

    redirectUrl,

    loginCompleted,

    loginFailed);

    Life is great except when the service redirects it does not decode the query string parameter before using it so it ends up at:
    http://localhost:54201/%2fAdmin%2fdefault.aspx

    With a 400 bad request HTTP error.

    Anybody know of a sample where the decode a url in javascript?

  • User profile image
    joechung

    Use decodeURIComponent(redirectUrl) instead of redirectUrl in your Sys.Services.AuthenticationService.login call if the problem is that redirectUrl is your desired URL encoded.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.