Add originalUrl to loginRedirect
Add originalUrl to loginRedirect

Any action that requires an account redirects to the registration page.
Unfortunately, when a user comes in from SEO or direct link causes ctx.originalUrl
not to be set and closing the register window causes them to be redirected to the
frontpage instead of the original post.

The problem is that ctx.originalUrl is not set when a comment page is directly accessed,
so a login page cannot access that property and therefore falls back to returning to frontpage.

The fix is easy. Whenever actions are called that requires a logged in user,
add a query parameter to the redirect if it exists, and if the path is the frontpage,
silence the query parameter for ctx.originalUrl to override.

uzi/reddit-mobile,uzi/reddit-mobile,madbook/reddit-mobile,madbook/reddit-mobile,uzi/reddit-mobile,madbook/reddit-mobile