diff --git a/config.js b/config.js index eadd485e6..e3f1ef76e 100644 --- a/config.js +++ b/config.js @@ -2,12 +2,13 @@ const config = { WEBPACK_WEB_PORT: 9090, WEBPACK_ELECTRON_PORT: 9091, WEB_SERVER_PORT: 1337, - DOMAIN: 'https://lbry.tv', + DOMAIN: 'lbry.tv', + URL: 'https://lbry.tv', SITE_TITLE: 'lbry.tv', LBRY_TV_API: 'https://api.lbry.tv', }; -config.DOMAIN_LOCAL = `http://localhost:${config.WEB_SERVER_PORT}`; -config.DOMAIN_DEV = `http://localhost:${config.WEBPACK_WEB_PORT}`; +config.URL_LOCAL = `http://localhost:${config.WEB_SERVER_PORT}`; +config.URL_DEV = `http://localhost:${config.WEBPACK_WEB_PORT}`; module.exports = config; diff --git a/lbrytv/middleware/redirect.js b/lbrytv/middleware/redirect.js index 2f373d1dd..2c09af97b 100644 --- a/lbrytv/middleware/redirect.js +++ b/lbrytv/middleware/redirect.js @@ -17,7 +17,7 @@ async function redirectMiddleware(ctx, next) { } if (redirectHosts.includes(requestHost)) { - const redirectUrl = config.DOMAIN + path; + const redirectUrl = config.URL + path; ctx.redirect(redirectUrl); return; } diff --git a/lbrytv/src/html.js b/lbrytv/src/html.js index a4c18aa16..7e5088964 100644 --- a/lbrytv/src/html.js +++ b/lbrytv/src/html.js @@ -1,4 +1,4 @@ -const { DOMAIN } = require('../../config.js'); +const { URL } = require('../../config.js'); const { generateStreamUrl } = require('../../ui/util/lbrytv'); const { getClaim } = require('./chainquery'); const { parseURI } = require('lbry-redux'); @@ -9,13 +9,13 @@ let html = fs.readFileSync(path.join(__dirname, '/../dist/index.html'), 'utf8'); const defaultHead = 'lbry.tv\n' + - `\n` + + `\n` + '\n' + '\n' + '\n' + - `\n` + + `\n` + '\n' + - `\n` + + `\n` + ''; function insertToHead(fullHtml, htmlToInsert = defaultHead) { @@ -45,7 +45,7 @@ function buildOgMetadata(uri, claim) { ? escapeHtmlProperty(truncateDescription(claim.description)) : `Watch ${title} on LBRY.tv`; const claimLanguage = escapeHtmlProperty(claim.language) || 'en_US'; - const claimThumbnail = escapeHtmlProperty(claim.thumbnail_url) || `${DOMAIN}/og.png`; + const claimThumbnail = escapeHtmlProperty(claim.thumbnail_url) || `${URL}/og.png`; const claimTitle = claim.channel && !isChannel ? `${title} from ${claim.channel} on LBRY.tv` : `${title} on LBRY.tv`; let head = ''; @@ -65,7 +65,7 @@ function buildOgMetadata(uri, claim) { head += ``; head += ``; // below should be canonical_url, but not provided by chainquery yet - head += ``; + head += ``; if (claim.source_media_type && claim.source_media_type.startsWith('video/')) { const videoUrl = generateStreamUrl(claim.name, claim.claim_id); diff --git a/ui/component/wunderbar/view.jsx b/ui/component/wunderbar/view.jsx index 8e322a400..6e9266c8c 100644 --- a/ui/component/wunderbar/view.jsx +++ b/ui/component/wunderbar/view.jsx @@ -1,5 +1,5 @@ // @flow -import { DOMAIN, DOMAIN_LOCAL, DOMAIN_DEV } from 'config'; +import { URL, URL_LOCAL, URL_DEV } from 'config'; import * as PAGES from 'constants/pages'; import * as ICONS from 'constants/icons'; import React from 'react'; @@ -12,9 +12,9 @@ import Tag from 'component/tag'; const L_KEY_CODE = 76; const ESC_KEY_CODE = 27; -const WEB_DEV_PREFIX = `${DOMAIN_DEV}/`; -const WEB_LOCAL_PREFIX = `${DOMAIN_LOCAL}/`; -const WEB_PROD_PREFIX = `${DOMAIN}/`; +const WEB_DEV_PREFIX = `${URL_DEV}/`; +const WEB_LOCAL_PREFIX = `${URL_LOCAL}/`; +const WEB_PROD_PREFIX = `${URL}/`; const SEARCH_PREFIX = `$/${PAGES.SEARCH}q=`; type Props = { diff --git a/ui/util/saved-passwords.js b/ui/util/saved-passwords.js index f326f947f..d1cc1cc2a 100644 --- a/ui/util/saved-passwords.js +++ b/ui/util/saved-passwords.js @@ -1,5 +1,6 @@ // @flow import { ipcRenderer } from 'electron'; +import { DOMAIN } from 'config'; let sessionPassword; @@ -11,7 +12,7 @@ function setCookie(name: string, value: string, days: number) { expires = '; expires=' + date.toUTCString(); } - document.cookie = `${name}=${value || ''}${expires}; path=/;samesite=strict;`; + document.cookie = `${name}=${value || ''}${expires}; domain=.${DOMAIN}; path=/; SameSite=Lax; Secure;`; } function getCookie(name: string) {