fixed rerouting after authentication