diff --git a/src/providers/steem/auth.js b/src/providers/steem/auth.js index 9f3f25da6..501bcd0ca 100644 --- a/src/providers/steem/auth.js +++ b/src/providers/steem/auth.js @@ -91,11 +91,15 @@ export const loginWithSC2 = async (accessToken) => { let avatar = ''; return new Promise((resolve, reject) => { - const jsonMetadata = JSON.parse(account.account.json_metadata); - if (Object.keys(jsonMetadata).length !== 0) { - avatar = jsonMetadata.profile.profile_image; - } + try { + const jsonMetadata = JSON.parse(account.account.json_metadata); + if (Object.keys(jsonMetadata).length !== 0) { + avatar = jsonMetadata.profile.profile_image; + } + } catch (error) { + reject(new Error('Invalid credentails, please check and try again')); + } const userData = { username: account.account.name, avatar, diff --git a/src/screens/steem-connect/config.js b/src/screens/steem-connect/config.js index 5c220837a..585ad4949 100644 --- a/src/screens/steem-connect/config.js +++ b/src/screens/steem-connect/config.js @@ -1,5 +1,5 @@ export const steemConnectOptions = { - base_url: 'https://v2.steemconnect.com/oauth2/authorize', + base_url: 'https://steemconnect.com/oauth2/authorize', client_id: 'esteem-app', redirect_uri: 'http://127.0.0.1:3415/', // http://127.0.0.1:3415 scope: 'vote,comment,delete_comment,comment_options,custom_json,claim_reward_balance',