Fixing Redirect in Authentication middleware