Skip to content

Latest commit

 

History

History
65 lines (50 loc) · 1.29 KB

reddit.md

File metadata and controls

65 lines (50 loc) · 1.29 KB
id title
reddit
Reddit

Documentation

https://www.reddit.com/dev/api/

Configuration

https://www.reddit.com/prefs/apps/

Options

The Reddit Provider comes with a set of default options:

You can override any of the options to suit your own use case.

Example

import RedditProvider from "next-auth/providers/reddit";
...
providers: [
  RedditProvider({
    clientId: process.env.REDDIT_CLIENT_ID,
    clientSecret: process.env.REDDIT_CLIENT_SECRET
  })
]
...

:::warning Reddit requires authorization every time you go through their page. :::

:::warning Only allows one callback URL per Client ID / Client Secret. :::

:::tip This Provider template only has a one hour access token to it and only has the "identity" scope. If you want to get a refresh token as well you must follow this:

providers: [
  RedditProvider({
    clientId: process.env.REDDIT_CLIENT_ID,
    clientSecret: process.env.REDDIT_CLIENT_SECRET,
    version: '2.0',
    authorization: {
      url: 'https://www.reddit.com/api/v1/authorize',
      params: {
        scope: 'identity',
        duration: 'permanent',
        response_type: 'code',
      },
    },
  }),
]

:::