copr: don't play with sessions if using ApiToken
This actually caused a weird situation leading to an unsuccessful build
upload, if user had a valid API token, but also an outdated session
cookie. The attempts failed with:
408 Request Timeout
What was happening client-side:
base_proxy.auth_check() (to check before upload...)
auth.make() // sets outdated auth.cookies, but not auth.auth!
=> fails
auth.make(reauth)
make_expensive()
sets auth.auth
keeps auth.cookies (outdated)
succeeds (auth.cookies set, auth.auth set, too)
build_proxy.create_from_file()
auth.make() // sets outdated auth.cookies, but not auth.auth
request attempt 1. => fails
auth.make(reauth)
make_expensive()
sets auth.auth
keeps auth.cookies (outdated)
request attempt 2. => timeouts serverside
The second attempt leading to server timeout is reproducible, and needs
further debugging (the bug is still present!). Seems like the request
(FileRequest class) in the 2nd attempt is somewhat broken, and leads to
wsgi/flask/werkzeug timeout (our code is not even called):
OSError: Apache/mod_wsgi request data read error: Partial results
are valid but processing is incomplete.
I even tried to restart server between the 1st and 2nd upload attempt,
and the server fails reproducibly.
This also shows us that the Client stores the "auth" object in multiple
instances, per each proxy. We should ideally fix this in the future.
Relates: #2232 (very likely)
Fixes: #2303