diff --git a/src/providers/steem/auth.js b/src/providers/steem/auth.js index 18ed62845..dae650842 100644 --- a/src/providers/steem/auth.js +++ b/src/providers/steem/auth.js @@ -99,13 +99,14 @@ export const loginWithSC2 = async (code) => { let avatar = ''; return new Promise((resolve, reject) => { + let jsonMetadata; try { - const jsonMetadata = JSON.parse(account.account.json_metadata); + jsonMetadata = JSON.parse(account.account.json_metadata) || ''; if (Object.keys(jsonMetadata).length !== 0) { avatar = jsonMetadata.profile.profile_image || ''; } } catch (error) { - reject(new Error('auth.invalid_credentials')); + jsonMetadata = ''; } const userData = { username: account.account.name,