Instead of redirecting to a spefic page, we are redirecting to the page provided in the next argument.
Passing the next parameter.
Small fix
Added a settings template to display the resend button.