Support custom redirect url from the 'switch' view

The 'login' view currently accepts a parameter specifying the
URL to redirect to after a successful login (via ?next=). This
adds the same support for the 'switch' view by reusing a couple
of lines of code from the Django login view.