WillPCG – sorry for not responding sooner. I looked at this for a while yesterday and it took me a while to figure out what the problem was.
The problem is happening because you are redirecting the users to a client page, as opposed to the admin dashboard – it’s not expecting the login form to be in the response.
Until I can figure out a solution, you can edit the default.js file and remove the following code:
else if (loginform.length > 0) {
SimpleModalLogin.showError(form, 'empty_both');
}
Let me know if that does not resolve the issue…
-Eric
Thanks for looking into this Eric. I really appreciate your help.
I opened the default.js file and removed the line of code – and now the login form successfully logs in any user. However it looks like its still not quite there – it has stopped automatically forwarding the users to the /client-portal/ page.
I’m going to spend a little more time working on this today – but if you have a second, please let me know what you think might be the issue.
Thanks again for all your help.
Just thinking about this, it makes sense that it is not forwarding. Well, actually it is, but the plugin is using an ajax call to get the response and it doesn’t know about your client page.
So, you have a couple of options. Question though – do you plan on protecting the client portal? Right now I can visit it w/o being logged in.
If you are, then I would suggest the following. First, you can put a unique id on the body of the client portal page(s), client_portal for example. Then update default.js:
var data = $('<div></div>').append(resp),
error = $('#login_error', data[0]),
client = $('#client_portal', data[0]), // new
loginform = $('#loginform', data[0]);
if (error.length > 0) {
$('p:first', form[0]).before(error);
}
else {
var redirect = $('#redirect_to', form[0]).val(),
href = location.href;
if (redirect.length > 0) {
if (SimpleModalLogin.url && SimpleModalLogin.url.indexOf("redirect_to") !== -1) {
var p = SimpleModalLogin.url.split("=");
href = unescape(p[1]);
}
else {
href = redirect;
}
}
// new
else if (client.length > 0) {
href = 'http://pinpointcreative.com/revision/client-portal/'; // enter the actual url here
}
window.location = href;
dialog.close();
}
Hope that helps.
-Eric
Looks like that did the trick. Everything is up and running at least on my end. I’m going to create a few more users and make sure testing from a few different setups – but I think we’re good. Thanks again for all your help!
Actually – ignore that post – I solved it.
Human error hurray 😉
/Riccard
I love your plugin but am running into this same issue. I am redirecting clients to seperate pages inside my client area ie.. domain/clients/this_client. I am generating the links using an extra meta field on the users and once a user is loged in there is a link on the footer for client area taking them to theirs which is protected and only available to them. I wanna use this plugin for my login but i want it to redirect to that clients page.