File tree Expand file tree Collapse file tree 4 files changed +60
-0
lines changed Expand file tree Collapse file tree 4 files changed +60
-0
lines changed Original file line number Diff line number Diff line change 1+ export default function Freshbooks ( options ) {
2+ return {
3+ id : 'freshbooks' ,
4+ name : 'Freshbooks' ,
5+ type : 'oauth' ,
6+ version : '2.0' ,
7+ params : { grant_type : 'authorization_code' } ,
8+ accessTokenUrl : 'https://api.freshbooks.com/auth/oauth/token' ,
9+ authorizationUrl : 'https://auth.freshbooks.com/service/auth/oauth/authorize?response_type=code' ,
10+ profileUrl : 'https://api.freshbooks.com/auth/api/v1/users/me' ,
11+ async profile ( profile ) {
12+ return {
13+ id : profile . response . id ,
14+ name : `${ profile . response . first_name } ${ profile . response . last_name } ` ,
15+ email : profile . response . email ,
16+ } ;
17+ } ,
18+ ...options
19+ } ;
20+ }
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ export type OAuthProviderType =
7272 | "FACEIT"
7373 | "FortyTwo"
7474 | "Foursquare"
75+ | "Freshbooks"
7576 | "FusionAuth"
7677 | "GitHub"
7778 | "GitLab"
Original file line number Diff line number Diff line change @@ -257,3 +257,9 @@ Providers.Zoho({
257257 clientId : "foo123" ,
258258 clientSecret : "bar123" ,
259259} )
260+
261+ // $ExpectType OAuthConfig<Profile>
262+ Providers . Freshbooks ( {
263+ clientId : "foo123" ,
264+ clientSecret : "bar123" ,
265+ } )
Original file line number Diff line number Diff line change 1+ ---
2+ id : freshbooks
3+ title : Freshbooks
4+ ---
5+
6+ ## Documentation
7+
8+ https://www.freshbooks.com/api/authenticating-with-oauth-2-0-on-the-new-freshbooks-api
9+
10+ ## Configuration
11+
12+ https://my.freshbooks.com/#/developer
13+
14+ ## Options
15+
16+ The Freshbooks Provider comes with a set of default options:
17+
18+ https://www.freshbooks.com/api/start
19+
20+ You can override any of the options to suit your own use case.
21+ ## Example
22+
23+ ``` js
24+ import Providers from ` next-auth/providers`
25+ ...
26+ providers: [
27+ Providers .Freshbooks ({
28+ clientId: process .env .FRESHBOOKS_CLIENT_ID ,
29+ clientSecret: process .env .FRESHBOOKS_CLIENT_SECRET ,
30+ })
31+ ]
32+ ...
33+ ```
You can’t perform that action at this time.
0 commit comments