Fix login/permission-denied views to correctly redirect to the right thing