Login redirect to previous page

I’m trying to make it so that after logging in with the Auth0 wordpress plugin login widget you get redirected to the previous page you were on, rather than the login page which is what’s currently happening. I looked through the documentations about it and tried out these:

function (user, context, callback) {
context.redirect = {
url: “https://ipqpubs.org
};
return callback(null, user, context);
}

function (user, context, callback) {
if (context.protocol === “redirect-callback”) {
// User was redirected to the /continue endpoint
} else {
// User is logging in directly
}
}

var options = {
auth: {
redirectUrl: ‘https://ipqpubs.org
}
};

None of them worked though, just gave error messages. Is it not possible to do this through rules? The documentation made it seem like that’s how it would be done.
I also tried to edit some php files through an FTP client but nothing I tried worked.
There’s not a specific page I’m trying to redirect to, just whatever page the user was on before they logged in.

Unfortunately rules can’t do this for you. Rules execute on the server side of Auth0 and by the time wordpress redirects you away from wordpress, you have lost the necessary context to know which page you were on when you requested authentication.

However, the good news is that this is supported by the wordpress plugin itself. See this troubleshooting page for instructions on how to configure your application to take advantage of wordpress’ built in redirect after login functionality.