-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ft 164489784 Implemented login with github
- Loading branch information
Showing
9 changed files
with
49 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import GithubStrategy from 'passport-github'; | ||
import { GetSocialTwitterGithub } from '../callbackHandler'; | ||
/** | ||
* @author Jacques Nyilinkindi | ||
* @returns Github strategy | ||
*/ | ||
const Github = new GithubStrategy( | ||
{ | ||
clientID: process.env.GITHUB_CLIENT_ID, | ||
clientSecret: process.env.GITHUB_CLIENT_SECRET, | ||
callbackURL: process.env.GITHUB_CALLBACK | ||
}, | ||
async (accessToken, refreshToken, profile, done) => { | ||
GetSocialTwitterGithub( | ||
accessToken, refreshToken, profile, done | ||
); | ||
} | ||
); | ||
export default Github; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import TwitterStrategy from 'passport-twitter'; | ||
import { GetSocialTwitter } from '../callbackHandler'; | ||
import { GetSocialTwitterGithub } from '../callbackHandler'; | ||
/** | ||
* @author Jacques Nyilinkindi | ||
* @returns Twitter strategy | ||
*/ | ||
const Twitter = new TwitterStrategy({ | ||
consumerKey: process.env.TWITTER_CONSUMER_KEY, | ||
consumerSecret: process.env.TWITTER_CONSUMER_SECRET, | ||
callbackURL: process.env.TWITTER_CALLBACK, | ||
}, | ||
async (token, tokenSecret, profile, done) => { | ||
GetSocialTwitter( | ||
token, tokenSecret, profile, done | ||
); | ||
}); | ||
const Twitter = new TwitterStrategy( | ||
{ | ||
consumerKey: process.env.TWITTER_CONSUMER_KEY, | ||
consumerSecret: process.env.TWITTER_CONSUMER_SECRET, | ||
callbackURL: process.env.TWITTER_CALLBACK, | ||
}, | ||
async (token, tokenSecret, profile, done) => { | ||
GetSocialTwitterGithub( | ||
token, tokenSecret, profile, done | ||
); | ||
} | ||
); | ||
export default Twitter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters