Fixed issue if ?next wasn't specified in login request.