diff --git a/CHANGELOG.md b/CHANGELOG.md index 9699453..adc1e2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 2.0.2 + +## Features + +- Update LinkedIn scopes +- Added possible scopes to README + # 2.0.1 ## Features diff --git a/README.md b/README.md index c2db13c..a49c3b3 100644 --- a/README.md +++ b/README.md @@ -162,8 +162,8 @@ export default function LinkedInPage() { | onSuccess | function | yes | | | onError | function | no | | | state | string | no | randomly generated string (recommend to keep default value) | -| scope | string | no | 'r_emailaddress' | -| | | | See your app scope [here](https://docs.microsoft.com/en-us/linkedin/shared/authentication/authentication?context=linkedin/context#permission-types). If there are more than one, delimited by a space | +| scope | string | no | 'email' | +| | | | Possible scopes: `email`, `profile` and `openid`. See your app scope [here](https://docs.microsoft.com/en-us/linkedin/shared/authentication/authentication?context=linkedin/context#permission-types). If there are more than one, delimited by a space | | children | function | no | Require if using `LinkedIn` component (render props) | Reference: [https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/context#step-2-request-an-authorization-code](https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/context#step-2-request-an-authorization-code) diff --git a/examples/nextjs/pages/index.js b/examples/nextjs/pages/index.js index 5637e2f..906a344 100644 --- a/examples/nextjs/pages/index.js +++ b/examples/nextjs/pages/index.js @@ -19,7 +19,7 @@ export default function Home() { console.log(code); setCode(code); }, - scope: 'r_emailaddress', + scope: 'email', onError: (error) => { console.log(error); setErrorMessage(error.errorMessage); diff --git a/preview/LinkedInPageHook.jsx b/preview/LinkedInPageHook.jsx index 67c0d58..d63307e 100644 --- a/preview/LinkedInPageHook.jsx +++ b/preview/LinkedInPageHook.jsx @@ -11,7 +11,7 @@ function LinkedInPage() { console.log(code); setCode(code); }, - scope: 'r_emailaddress', + scope: 'email', onError: (error) => { console.log(error); setErrorMessage(error.errorMessage); diff --git a/preview/LinkedInPageRenderProps.jsx b/preview/LinkedInPageRenderProps.jsx index b63cfc2..ce98e03 100644 --- a/preview/LinkedInPageRenderProps.jsx +++ b/preview/LinkedInPageRenderProps.jsx @@ -18,7 +18,7 @@ function LinkedInPage() { console.log(code); setCode(code); }} - scope="r_emailaddress r_liteprofile" + scope="email profile" onError={(error) => { console.log(error); setErrorMessage(error.errorMessage); diff --git a/src/useLinkedIn.tsx b/src/useLinkedIn.tsx index 471be2d..a1d242a 100644 --- a/src/useLinkedIn.tsx +++ b/src/useLinkedIn.tsx @@ -24,7 +24,7 @@ export function useLinkedIn({ clientId, onSuccess, onError, - scope = 'r_emailaddress', + scope = 'email', state = '', closePopupMessage = 'User closed the popup', }: useLinkedInType) {