Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/meteor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@
"passport-github2": "^0.1.12",
"passport-google-oauth20": "^2.0.0",
"passport-oauth2": "^1.8.0",
"passport-twitter": "^1.0.4",
"path": "^0.12.7",
"path-to-regexp": "^6.3.0",
"pino": "10.3.1",
Expand Down Expand Up @@ -400,6 +401,7 @@
"@types/passport-github2": "^1.2.9",
"@types/passport-google-oauth20": "^2",
"@types/passport-oauth2": "^1",
"@types/passport-twitter": "^1",
"@types/prometheus-gc-stats": "^0.6.4",
"@types/proxy-from-env": "^1.0.4",
"@types/proxyquire": "^1.3.31",
Expand Down
4 changes: 4 additions & 0 deletions apps/meteor/server/lib/oauth/configureOAuthServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export const configureOAuthServices = (oauthServiceConfig: OAuthServiceConfig[],
{
clientID: config.clientId,
clientSecret: config.clientSecret,
consumerKey: config.clientId,
consumerSecret: config.clientSecret,
callbackURL: `${siteUrl}/oauth/${config.provider}/callback`,
state: true,
pkce: true,
Expand All @@ -36,6 +38,8 @@ export const configureOAuthServices = (oauthServiceConfig: OAuthServiceConfig[],
const profileWithRaw = profile as Profile & { _json?: Record<string, unknown>; _raw?: string };
const { _json, _raw, ...restProfile } = profileWithRaw;

console.log('profile - ', profile);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved

// eslint-disable-next-line @typescript-eslint/await-thenable
const user = await Accounts.updateOrCreateUserFromExternalService(
config.provider,
Expand Down
5 changes: 5 additions & 0 deletions apps/meteor/server/lib/oauth/oauthConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Strategy } from 'passport';
import { Strategy as FacebookStrategy } from 'passport-facebook';
import { Strategy as GitHubStrategy } from 'passport-github2';
import { Strategy as GoogleStrategy } from 'passport-google-oauth20';
import { Strategy as TwitterStrategy } from 'passport-twitter';

export type OAuthConfig = {
strategy: new (...args: any[]) => Strategy;
Expand All @@ -21,6 +22,10 @@ export const OAuthConfigs: Record<string, OAuthConfig> = {
strategy: GoogleStrategy,
scope: ['email', 'profile'],
},
twitter: {
strategy: TwitterStrategy,
scope: ['email', 'profile'],
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
} as const;

export type Provider = keyof typeof OAuthConfigs;
56 changes: 56 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9767,6 +9767,7 @@ __metadata:
"@types/passport-github2": "npm:^1.2.9"
"@types/passport-google-oauth20": "npm:^2"
"@types/passport-oauth2": "npm:^1"
"@types/passport-twitter": "npm:^1"
"@types/prometheus-gc-stats": "npm:^0.6.4"
"@types/proxy-from-env": "npm:^1.0.4"
"@types/proxyquire": "npm:^1.3.31"
Expand Down Expand Up @@ -9913,6 +9914,7 @@ __metadata:
passport-github2: "npm:^0.1.12"
passport-google-oauth20: "npm:^2.0.0"
passport-oauth2: "npm:^1.8.0"
passport-twitter: "npm:^1.0.4"
path: "npm:^0.12.7"
path-to-regexp: "npm:^6.3.0"
pino: "npm:10.3.1"
Expand Down Expand Up @@ -14702,6 +14704,16 @@ __metadata:
languageName: node
linkType: hard

"@types/passport-twitter@npm:^1":
version: 1.0.40
resolution: "@types/passport-twitter@npm:1.0.40"
dependencies:
"@types/express": "npm:*"
"@types/passport": "npm:*"
checksum: 10/cf97db9469acff4dffff11ecf4e12ac016fc55d478e2fbd881c7961fe36f26ba232a55f74fdd0bd0216ea49d3a9dcd4e18afac852b6bb10450f43413e4a464b7
languageName: node
linkType: hard

"@types/passport@npm:*, @types/passport@npm:^1.0.17":
version: 1.0.17
resolution: "@types/passport@npm:1.0.17"
Expand Down Expand Up @@ -29241,6 +29253,13 @@ __metadata:
languageName: node
linkType: hard

"oauth@npm:0.9.x":
version: 0.9.15
resolution: "oauth@npm:0.9.15"
checksum: 10/6b0b10be19a461da417a37ea2821a773ef74dd667563291e1e83b2024b88e6571b0323a0a6887f2390fbaf28cc6ce5bfe0484fc22162b975305b1e19b76f5597
languageName: node
linkType: hard

"object-assign@npm:^4, object-assign@npm:^4.0.1, object-assign@npm:^4.1.1":
version: 4.1.1
resolution: "object-assign@npm:4.1.1"
Expand Down Expand Up @@ -29951,6 +29970,17 @@ __metadata:
languageName: node
linkType: hard

"passport-oauth1@npm:1.x.x":
version: 1.3.0
resolution: "passport-oauth1@npm:1.3.0"
dependencies:
oauth: "npm:0.9.x"
passport-strategy: "npm:1.x.x"
utils-merge: "npm:1.x.x"
checksum: 10/56f725cf3e3358ccb72212a6342e237ae9366172b94fdb9ac8ab380456da07dc1bb776bcdcddc9964e8e9056922fbf31c2f142d0421fd8a5b0140132d0cd9671
languageName: node
linkType: hard

"passport-oauth2@npm:1.x.x, passport-oauth2@npm:^1.8.0":
version: 1.8.0
resolution: "passport-oauth2@npm:1.8.0"
Expand All @@ -29971,6 +30001,16 @@ __metadata:
languageName: node
linkType: hard

"passport-twitter@npm:^1.0.4":
version: 1.0.4
resolution: "passport-twitter@npm:1.0.4"
dependencies:
passport-oauth1: "npm:1.x.x"
xtraverse: "npm:0.1.x"
checksum: 10/46c2efcbd8893c2de329770f16703b027531e2becfc8865dd288290635dcc9a678bbcec82a66ad52e49742bccd77ff4fc49f576fef2d711f49363e1b75ac1e80
languageName: node
linkType: hard

"passport@npm:^0.7.0":
version: 0.7.0
resolution: "passport@npm:0.7.0"
Expand Down Expand Up @@ -37780,6 +37820,13 @@ __metadata:
languageName: node
linkType: hard

"xmldom@npm:0.1.x":
version: 0.1.31
resolution: "xmldom@npm:0.1.31"
checksum: 10/eddc09391c928be61c504a355d5b7c42cbec526e94cc1e2d092d006ed5bc1525b869fb922cbcf3f6f7aac946a6b25ec4243dc2630afb5cbec61b723829211792
languageName: node
linkType: hard

"xorshift@npm:^1.1.1":
version: 1.2.0
resolution: "xorshift@npm:1.2.0"
Expand Down Expand Up @@ -37815,6 +37862,15 @@ __metadata:
languageName: node
linkType: hard

"xtraverse@npm:0.1.x":
version: 0.1.0
resolution: "xtraverse@npm:0.1.0"
dependencies:
xmldom: "npm:0.1.x"
checksum: 10/86e837a626ef363c01efa55a3e20b1d85b49d87f3de504955af119b451cb1f2c63e887bff6061335314c1d49005d851f4bc1d0cf2603dce18271aceb3e673d8a
languageName: node
linkType: hard

"xxhashjs@npm:~0.2.2":
version: 0.2.2
resolution: "xxhashjs@npm:0.2.2"
Expand Down
Loading