-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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 )'} |
There was a problem hiding this comment.
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 (
$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, | ||
]; |
There was a problem hiding this comment.
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))}> |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
No description provided.