Skip to content

Commit c387f32

Browse files
geraldm74Gerald McNicholl
andauthored
feat(provider): add EVE Online provider (#1227)
* Adding EVEOnline provider * Adding EVEOnline provider * Adding EVEOnline provider * Adding EVEOnline provider * Adding EVEOnline provider * Adding EVEOnline provider * Adding EVEOnline provider * Adding EVEOnline provider Co-authored-by: Gerald McNicholl <[email protected]>
1 parent 562bcf2 commit c387f32

File tree

4 files changed

+81
-0
lines changed

4 files changed

+81
-0
lines changed

src/providers/eveonline.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export default (options) => {
2+
return {
3+
id: 'eveonline',
4+
name: 'EVE Online',
5+
type: 'oauth',
6+
version: '2.0',
7+
params: { grant_type: 'authorization_code' },
8+
accessTokenUrl: 'https://login.eveonline.com/oauth/token',
9+
authorizationUrl: 'https://login.eveonline.com/oauth/authorize?response_type=code',
10+
profileUrl: 'https://login.eveonline.com/oauth/verify',
11+
profile: (profile) => {
12+
return {
13+
id: profile.CharacterID,
14+
name: profile.CharacterName,
15+
image: `https://image.eveonline.com/Character/${profile.CharacterID}_128.jpg`,
16+
email: null
17+
}
18+
},
19+
...options
20+
}
21+
}

src/providers/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Cognito from './cognito'
1010
import Credentials from './credentials'
1111
import Discord from './discord'
1212
import Email from './email'
13+
import EVEOnline from './eveonline'
1314
import Facebook from './facebook'
1415
import Foursquare from './foursquare'
1516
import FusionAuth from './fusionauth'
@@ -46,6 +47,7 @@ export default {
4647
Credentials,
4748
Discord,
4849
Email,
50+
EVEOnline,
4951
Facebook,
5052
Foursquare,
5153
FusionAuth,

www/docs/providers/eveonline.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
id: eveonline
3+
title: EVE Online
4+
---
5+
6+
## Documentation
7+
8+
https://developers.eveonline.com/blog/article/sso-to-authenticated-calls
9+
10+
## Configuration
11+
12+
https://developers.eveonline.com/
13+
14+
## Example
15+
16+
```js
17+
import Providers from `next-auth/providers`
18+
...
19+
providers: [
20+
Providers.EVEOnline({
21+
clientId: process.env.EVE_CLIENT_ID,
22+
clientSecret: process.env.EVE_CLIENT_SECRET
23+
})
24+
]
25+
...
26+
```
27+
28+
:::tip When creating your application, make sure to select `Authentication Only` as the connection type.
29+
30+
:::tip If using JWT for the session, you can add the `CharacterID` to the JWT token and session. Example:
31+
32+
```js
33+
...
34+
options: {
35+
jwt: {
36+
secret: process.env.JWT_SECRET,
37+
},
38+
callbacks: {
39+
jwt: async (token, user, account, profile, isNewUser) => {
40+
if (profile) {
41+
token = {
42+
...token,
43+
id: profile.CharacterID,
44+
}
45+
}
46+
return token;
47+
},
48+
session: async (session, token) => {
49+
if (token) {
50+
session.user.id = token.id;
51+
}
52+
return session;
53+
}
54+
}
55+
}
56+
...
57+
```

www/providers.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"credentials": "Credentials",
1212
"discord": "Discord",
1313
"email": "Email",
14+
"eveonline": "EVE Online",
1415
"facebook": "Facebook",
1516
"foursquare": "Foursquare",
1617
"fusionauth": "FusionAuth",

0 commit comments

Comments
 (0)