From e8371ab23a422ec78f704dce68c3594df135941a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Reina?= Date: Tue, 26 Jul 2022 10:43:45 +0200 Subject: [PATCH] docs(providers): update custom Reddit provider to v4 (#4985) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update custom reddit provider to v4 * Reuse RedditProvider's default options * Apply suggestions from code review Co-authored-by: Balázs Orbán --- docs/docs/providers/reddit.md | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/docs/docs/providers/reddit.md b/docs/docs/providers/reddit.md index a203e113ea..4c61b4d6a1 100644 --- a/docs/docs/providers/reddit.md +++ b/docs/docs/providers/reddit.md @@ -46,27 +46,15 @@ This Provider template only has a one hour access token to it and only has the " ```js providers: [ - { - id: "reddit", - name: "Reddit", + RedditProvider({ clientId: process.env.REDDIT_CLIENT_ID, clientSecret: process.env.REDDIT_CLIENT_SECRET, - scope: "identity mysubreddits read", //Check Reddit API Documentation for more. The identity scope is required. - type: "oauth", - version: "2.0", - params: { grant_type: "authorization_code" }, - accessTokenUrl: " https://www.reddit.com/api/v1/access_token", - authorizationUrl: - "https://www.reddit.com/api/v1/authorize?response_type=code&duration=permanent", - profileUrl: "https://oauth.reddit.com/api/v1/me", - profile: (profile) => { - return { - id: profile.id, - name: profile.name, - email: null, - } + authorization: { + params: { + duration: 'permanent', + }, }, - }, + }), ] ```