diff --git a/dist/bundle.es.js b/dist/bundle.es.js index cb9f256..9a93afa 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -320,17 +320,18 @@ Lbryio.getAuthToken = () => new Promise(resolve => { Lbryio.getCurrentUser = () => Lbryio.call('user', 'me'); -Lbryio.authenticate = domain => { +Lbryio.authenticate = (domain, language) => { if (!Lbryio.enabled) { + const params = { + id: 1, + primary_email: 'disabled@lbry.io', + has_verified_email: true, + is_identity_verified: true, + is_reward_approved: false, + language: language || 'en' + }; return new Promise(resolve => { - resolve({ - id: 1, - language: 'en', - primary_email: 'disabled@lbry.io', - has_verified_email: true, - is_identity_verified: true, - is_reward_approved: false - }); + resolve(params); }); } @@ -358,7 +359,7 @@ Lbryio.authenticate = domain => { const appId = domain && domain !== 'lbry.tv' ? (domain.replace(/[.]/gi, '') + status.installation_id).slice(0, 66) : status.installation_id; Lbryio.call('user', 'new', { auth_token: '', - language: 'en', + language: language || 'en', app_id: appId }, 'post').then(response => { if (!response.auth_token) { diff --git a/dist/bundle.js b/dist/bundle.js index 6351c77..4fbf15f 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -628,17 +628,18 @@ Lbryio.getCurrentUser = function () { return Lbryio.call('user', 'me'); }; -Lbryio.authenticate = function (domain) { +Lbryio.authenticate = function (domain, language) { if (!Lbryio.enabled) { + var params = { + id: 1, + primary_email: 'disabled@lbry.io', + has_verified_email: true, + is_identity_verified: true, + is_reward_approved: false, + language: language || 'en' + }; return new Promise(function (resolve) { - resolve({ - id: 1, - language: 'en', - primary_email: 'disabled@lbry.io', - has_verified_email: true, - is_identity_verified: true, - is_reward_approved: false - }); + resolve(params); }); } @@ -669,7 +670,7 @@ Lbryio.authenticate = function (domain) { var appId = domain && domain !== 'lbry.tv' ? (domain.replace(/[.]/gi, '') + status.installation_id).slice(0, 66) : status.installation_id; Lbryio.call('user', 'new', { auth_token: '', - language: 'en', + language: language || 'en', app_id: appId }, 'post').then(function (response) { if (!response.auth_token) { diff --git a/src/lbryio.js b/src/lbryio.js index 7620095..38e0c26 100644 --- a/src/lbryio.js +++ b/src/lbryio.js @@ -111,17 +111,19 @@ Lbryio.getAuthToken = () => Lbryio.getCurrentUser = () => Lbryio.call('user', 'me'); -Lbryio.authenticate = domain => { +Lbryio.authenticate = (domain, language) => { if (!Lbryio.enabled) { + const params = { + id: 1, + primary_email: 'disabled@lbry.io', + has_verified_email: true, + is_identity_verified: true, + is_reward_approved: false, + language: language || 'en', + }; + return new Promise(resolve => { - resolve({ - id: 1, - language: 'en', - primary_email: 'disabled@lbry.io', - has_verified_email: true, - is_identity_verified: true, - is_reward_approved: false, - }); + resolve(params); }); } @@ -162,7 +164,7 @@ Lbryio.authenticate = domain => { 'new', { auth_token: '', - language: 'en', + language: language || 'en', app_id: appId, }, 'post'