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

Linkedin scope update #95

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 2.0.2

## Features

- Update LinkedIn scopes
- Added possible scopes to README

# 2.0.1

## Features
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion preview/LinkedInPageHook.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function LinkedInPage() {
console.log(code);
setCode(code);
},
scope: 'r_emailaddress',
scope: 'email',
onError: (error) => {
console.log(error);
setErrorMessage(error.errorMessage);
Expand Down
2 changes: 1 addition & 1 deletion preview/LinkedInPageRenderProps.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/useLinkedIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function useLinkedIn({
clientId,
onSuccess,
onError,
scope = 'r_emailaddress',
scope = 'email',
state = '',
closePopupMessage = 'User closed the popup',
}: useLinkedInType) {
Expand Down