Skip to content

Commit 42596fb

Browse files
paulkennethkentPaul Kenneth Kent
authored andcommitted
feat: add strava provider (#986)
* Add Strava as a provider * Add documentation for Strava provider * Fix lint errors Co-authored-by: Paul Kenneth Kent <paul@ventureharbour.com>
1 parent 68d0f94 commit 42596fb

File tree

6 files changed

+49
-1
lines changed

6 files changed

+49
-1
lines changed

src/providers/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import Netlify from './netlify'
2323
import Okta from './okta'
2424
import Slack from './slack'
2525
import Spotify from './spotify'
26+
import Strava from './strava'
2627
import Twitch from './twitch'
2728
import Twitter from './twitter'
2829
import Yandex from './yandex'
@@ -53,6 +54,7 @@ export default {
5354
Okta,
5455
Slack,
5556
Spotify,
57+
Strava,
5658
Twitter,
5759
Twitch,
5860
Yandex

src/providers/strava.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
export default (options) => {
2+
return {
3+
id: 'strava',
4+
name: 'Strava',
5+
type: 'oauth',
6+
version: '2.0',
7+
scope: 'read',
8+
params: { grant_type: 'authorization_code' },
9+
accessTokenUrl: 'https://www.strava.com/api/v3/oauth/token',
10+
authorizationUrl:
11+
'https://www.strava.com/api/v3/oauth/authorize?response_type=code',
12+
profileUrl: 'https://www.strava.com/api/v3/athlete',
13+
profile: (profile) => {
14+
return {
15+
id: profile.id,
16+
name: profile.firstname,
17+
image: profile.profile
18+
}
19+
},
20+
...options
21+
}
22+
}

www/docs/configuration/providers.md

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ NextAuth.js is designed to work with any OAuth service, it supports OAuth 1.0, 1
3333
* [Okta](/providers/Okta)
3434
* [Slack](/providers/slack)
3535
* [Spotify](/providers/spotify)
36+
* [Strava](/providers/strava)
3637
* [Twitch](/providers/Twitch)
3738
* [Twitter](/providers/twitter)
3839
* [Yandex](/providers/yandex)

www/docs/faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ You can use also NextAuth.js with any database using a custom database adapter,
2323

2424
### What authentication services does NextAuth.js support?
2525

26-
NextAuth.js includes built-in support for signing in with Apple, Atlassian, Auth0, Azure Active Directory B2C, Google, Battle.net, Box, AWS Cognito, Discord, Facebook, Foursquare, FusionAuth, GitHub, GitLab, Google, Open ID Identity Server, Mixer, Netlify, Okta, Slack, Spotify, Twitch, Twitter and Yandex.
26+
NextAuth.js includes built-in support for signing in with Apple, Atlassian, Auth0, Azure Active Directory B2C, Google, Battle.net, Box, AWS Cognito, Discord, Facebook, Foursquare, FusionAuth, GitHub, GitLab, Google, Open ID Identity Server, Mixer, Netlify, Okta, Slack, Spotify, Strava, Twitch, Twitter and Yandex.
2727

2828
NextAuth.js also supports email for passwordless sign in, which is useful for account recovery or for people who are not able to use an account with the configured OAuth services (e.g. due to service outage, account suspension or otherwise becoming locked out of an account).
2929

www/docs/providers/strava.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
id: strava
3+
title: Strava
4+
---
5+
6+
## Documentation
7+
8+
http://developers.strava.com/docs/reference/
9+
10+
## Example
11+
12+
```js
13+
import Providers from 'next-auth/providers'
14+
...
15+
providers: [
16+
Providers.Strava({
17+
clientId: process.env.STRAVA_CLIENT_ID,
18+
clientSecret: process.env.STRAVA_CLIENT_SECRET,
19+
})
20+
}
21+
...
22+
```

www/sidebars.js

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ module.exports = {
4646
'providers/okta',
4747
'providers/slack',
4848
'providers/spotify',
49+
'providers/strava',
4950
'providers/twitch',
5051
'providers/twitter',
5152
'providers/yandex'

0 commit comments

Comments
 (0)