auth header token

This commit is contained in:
Jessop Breth 2019-05-29 13:40:57 -04:00 committed by Sean Yesmunt
parent f62cbcbcb9
commit 601c081f10
2 changed files with 6 additions and 1 deletions

View file

@ -119,7 +119,7 @@
"jsmediatags": "^3.8.1",
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#02f6918238110726c0b3b4248c61a84ac0b969e3",
"lbry-redux": "lbryio/lbry-redux#ed94218cdb3409b963aec136ffe3c11c9e3bc875",
"lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",

View file

@ -89,6 +89,7 @@ Lbryio.setOverride(
() =>
new Promise(resolve => {
if (authToken) {
Lbry.setApiHeader('X-Lbry-Auth-Token', authToken);
resolve(authToken);
} else {
// @if TARGET='app'
@ -101,6 +102,10 @@ Lbryio.setOverride(
// @endif
// @if TARGET='web'
const { auth_token: authToken } = cookie.parse(document.cookie);
if (authToken) {
Lbry.setApiHeader('X-Lbry-Auth-Token', authToken);
}
resolve(authToken);
// @endif
}