File tree 2 files changed +71
-0
lines changed
packages/next-auth/src/providers
2 files changed +71
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ id : pinterest
3
+ title : Pinterest
4
+ ---
5
+
6
+ ## Documentation
7
+
8
+ https://developers.pinterest.com/docs/getting-started/authentication/
9
+
10
+ ## Configuration
11
+
12
+ https://developers.pinterest.com/apps/
13
+
14
+ ## Options
15
+
16
+ The ** Pinterest Provider** comes with a set of default options:
17
+
18
+ - [ Pinterest Provider options] ( https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/pinterest.ts )
19
+
20
+ You can override any of the options to suit your own use case.
21
+
22
+ ## Example
23
+
24
+ ``` ts
25
+ import PinterestProvider from " next-auth/providers/pinterest"
26
+ ...
27
+ providers : [
28
+ PinterestProvider ({
29
+ clientId: process .env .PINTEREST_ID ,
30
+ clientSecret: process .env .PINTEREST_SECRET
31
+ })
32
+ ]
33
+ ...
34
+
35
+ :::tip
36
+ To use in production , make sure the app has standard API access and not trial access
37
+ :::
Original file line number Diff line number Diff line change
1
+ import { OAuthConfig , OAuthUserConfig } from "."
2
+
3
+ export interface PinterestProfile extends Record < string , any > {
4
+ account_type : "BUSINESS" | "PINNER"
5
+ profile_image : string
6
+ website_url : string
7
+ username : string
8
+ }
9
+
10
+ export default function PinterestProvider < P extends PinterestProfile > (
11
+ options : OAuthUserConfig < P >
12
+ ) : OAuthConfig < P > {
13
+ return {
14
+ id : "pinterest" ,
15
+ name : "Pinterest" ,
16
+ type : "oauth" ,
17
+ authorization : {
18
+ url : "https://www.pinterest.com/oauth" ,
19
+ params : { scope : "user_accounts:read" } ,
20
+ } ,
21
+ checks : [ "state" ] ,
22
+ token : "https://api.pinterest.com/v5/oauth/token" ,
23
+ userinfo : "https://api.pinterest.com/v5/user_account" ,
24
+ profile ( { username, profile_image } ) {
25
+ return {
26
+ id : username ,
27
+ name : username ,
28
+ image : profile_image ,
29
+ email : null ,
30
+ }
31
+ } ,
32
+ options,
33
+ }
34
+ }
You can’t perform that action at this time.
1 commit comments
vercel[bot] commentedon Oct 9, 2022
Successfully deployed to the following URLs:
next-auth – ./
next-auth.js.org
www.next-auth.js.org
next-auth-git-main-nextauthjs.vercel.app
next-auth-phi-two.vercel.app
next-auth-nextauthjs.vercel.app