auth takes language for user new
This commit is contained in:
parent
2a9d04b2ef
commit
57b8625454
3 changed files with 34 additions and 30 deletions
15
dist/bundle.es.js
vendored
15
dist/bundle.es.js
vendored
|
@ -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) {
|
||||
return new Promise(resolve => {
|
||||
resolve({
|
||||
const params = {
|
||||
id: 1,
|
||||
language: 'en',
|
||||
primary_email: 'disabled@lbry.io',
|
||||
has_verified_email: true,
|
||||
is_identity_verified: true,
|
||||
is_reward_approved: false
|
||||
});
|
||||
is_reward_approved: false,
|
||||
language: language || 'en'
|
||||
};
|
||||
return new Promise(resolve => {
|
||||
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) {
|
||||
|
|
15
dist/bundle.js
vendored
15
dist/bundle.js
vendored
|
@ -628,17 +628,18 @@ Lbryio.getCurrentUser = function () {
|
|||
return Lbryio.call('user', 'me');
|
||||
};
|
||||
|
||||
Lbryio.authenticate = function (domain) {
|
||||
Lbryio.authenticate = function (domain, language) {
|
||||
if (!Lbryio.enabled) {
|
||||
return new Promise(function (resolve) {
|
||||
resolve({
|
||||
var params = {
|
||||
id: 1,
|
||||
language: 'en',
|
||||
primary_email: 'disabled@lbry.io',
|
||||
has_verified_email: true,
|
||||
is_identity_verified: true,
|
||||
is_reward_approved: false
|
||||
});
|
||||
is_reward_approved: false,
|
||||
language: language || 'en'
|
||||
};
|
||||
return new Promise(function (resolve) {
|
||||
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) {
|
||||
|
|
|
@ -111,17 +111,19 @@ Lbryio.getAuthToken = () =>
|
|||
|
||||
Lbryio.getCurrentUser = () => Lbryio.call('user', 'me');
|
||||
|
||||
Lbryio.authenticate = domain => {
|
||||
Lbryio.authenticate = (domain, language) => {
|
||||
if (!Lbryio.enabled) {
|
||||
return new Promise(resolve => {
|
||||
resolve({
|
||||
const params = {
|
||||
id: 1,
|
||||
language: 'en',
|
||||
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(params);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -162,7 +164,7 @@ Lbryio.authenticate = domain => {
|
|||
'new',
|
||||
{
|
||||
auth_token: '',
|
||||
language: 'en',
|
||||
language: language || 'en',
|
||||
app_id: appId,
|
||||
},
|
||||
'post'
|
||||
|
|
Loading…
Reference in a new issue