handle captive portal login in a smarter way