-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(provider): Add Mail.ru OAuth Service Provider and Callback snipp…
…et (#522) * Update callback.js - Fix Mail.ru bug (missing request parameter: access_token) Note: setGetAccessTokenProfileUrl should be added to Mail.ru provider to enable support. * Add Mail.ru OAuth Service Provider * Update callbacks.md - Fix broken callbacks snippet. * Update callback.js - Bug fix #522 (comment) - Minor refactoring. * Fix: Code linting. * Update callback.js Improve approach for building of URL based review recommendation. * Feat: Reduce API surface expansion Make use of provider.id === "mailru" as suggested in review discussion in place of setGetAccessTokenProfileUrl. * Fix: Code linting
- Loading branch information
1 parent
0989ef6
commit 2205cfa
Showing
6 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export default (options) => { | ||
return { | ||
id: 'mailru', | ||
name: 'Mail.ru', | ||
type: 'oauth', | ||
version: '2.0', | ||
scope: 'userinfo', | ||
params: { | ||
grant_type: 'authorization_code' | ||
}, | ||
accessTokenUrl: 'https://oauth.mail.ru/token', | ||
requestTokenUrl: 'https://oauth.mail.ru/token', | ||
authorizationUrl: 'https://oauth.mail.ru/login?response_type=code', | ||
profileUrl: 'https://oauth.mail.ru/userinfo', | ||
profile: (profile) => { | ||
return { | ||
id: profile.id, | ||
name: profile.name, | ||
email: profile.email, | ||
image: profile.image | ||
} | ||
}, | ||
...options | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
id: Mail.ru | ||
title: Mail.ru | ||
--- | ||
|
||
## Documentation | ||
|
||
https://o2.mail.ru/docs | ||
|
||
## Configuration | ||
|
||
https://o2.mail.ru/app/ | ||
|
||
## Example | ||
|
||
```js | ||
import Providers from `next-auth/providers` | ||
... | ||
providers: [ | ||
Providers.MailRu({ | ||
clientId: process.env.MAILRU_CLIENT_ID, | ||
clientSecret: process.env.MAILRU_CLIENT_SECRET | ||
}) | ||
] | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters