Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Oneclick Auth & Reauth added in ZohoCRM #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NiloyDas789
Copy link
Contributor

No description provided.

Copy link
Member

@shuvomohajan shuvomohajan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check


const scopes = 'ZohoCRM.modules.ALL,ZohoCRM.settings.ALL,ZohoCRM.users.Read,zohocrm.files.CREATE'
const nextPage = () => {
console.log('crmConf', crmConf)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all consoles

@@ -13,7 +13,7 @@ const SelectAuthorizationType = ({ name, options, selectedAuthType, handleChange
onClick={() => handleChange(option)}
className="radio-input"
/>
{option}
{option}{option === 'One Click Authorization' ? ' (Beta )' : ' (Recomended )'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Beta ) add white space after (

Comment on lines +648 to +657
$apiEndpoint = 'https://www.zohoapis.com/crm/v2/users?type=AllUsers';
$authorizationHeader['Authorization'] = 'Bearer ' . $requestParams->code;
$authorizationHeader['Content-Type'] = 'application/json';

$response = HttpHelper::get($apiEndpoint, null, $authorizationHeader);

$user['user'] = [
'displayName' => $response->users[0]->full_name,
'emailAddress' => $response->users[0]->email,
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get only the logged user name and email,

users[0] could be the guy who is not logged in.

@@ -227,7 +227,7 @@ export default function GoogleSheetAuthorization({
</button>
)}
<br />
<button onClick={() => nextPage(2)} className="btn f-right btcd-btn-lg purple sh-sm flx" type="button" disabled={!selectedUserId || authData.length === 0}>
<button onClick={() => nextPage(2)} className="btn f-right btcd-btn-lg purple sh-sm flx" type="button" disabled={!selectedUserId || (authData.length === 0 && !isEdit && (sheetConf.tokenDetails == null))}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary bracket (sheetConf.tokenDetails == null)

})
}
} catch (error) {
console.error('handleAuthData error:', error.message);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setSnackbar to show the error to the user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants