I am creating a web app which uses jQuery to authenticate:
$.ajax({
url: "/session/create?format=json",
type: "GET",
dataType: "json",
cache: false,
username: $("#signin-email").val(),
password: $("#signin-password").val(),
success: function(data) {
if(data.success) {
success = true;
}
}
});
The problem is that the code only makes the AJAX-request when the username
does not include things like an @
(probably because the @ is a seperator for authentication and host in the URL), which is required in my app. Can anyone help me with how I can do this? I do not mind changing the back-end a little bit, but requiring users to have an @
-less email is not an option.
Oh, my back-end is a Ruby-on-Rails app.