Basic oauth breaks because of _check_login function

Issue #297