add logout to connect-devices view & fix login loop issue