feat: add support for switching accounts (cookie based auth only) (#236)

* feat: add support for switching accounts

* style: lint
This commit is contained in:
LuanRT
2022-11-12 16:26:02 -03:00
committed by GitHub
parent 0130229236
commit 5ea0a0ebf8
7 changed files with 42 additions and 24 deletions

View File

@@ -103,9 +103,12 @@ export default class HTTPClient {
if (this.#cookie) {
const papisid = getStringBetweenStrings(this.#cookie, 'PAPISID=', ';');
if (papisid) {
request_headers.set('authorization', await generateSidAuth(papisid));
request_headers.set('x-goog-authuser', this.#session.account_index.toString());
}
request_headers.set('cookie', this.#cookie);
}
}