Skip to content

Commit 1f5c571

Browse files
committed
minor change to auth
1 parent 204552b commit 1f5c571

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

config/strategies.coffee

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ GITHUB_CLIENT_ID = process.env.GITHUB_CLIENT_ID || 'notvalidkey'
1111
GITHUB_CLIENT_SECRET = process.env.GITHUB_CLIENT_SECRET || 'notvalidkey'
1212
GITHUB_CALLBACK_URL = url.resolve process.env.CALLBACK_BASE_URL, '/auth/github/callback'
1313

14-
1514
twitterDone = (accessToken, tokenSecret, profile, callback) ->
16-
users = new Users()
17-
users.find_by_service 'twitter', profile.id, callback
15+
authDone 'twitter', profile, callback
1816

1917
githubDone = (accessToken, tokenSecret, profile, callback) ->
18+
authDone 'github', profile, callback
19+
20+
authDone = (provider, profile, callback) ->
2021
users = new Users()
21-
users.find_by_service 'github', profile.id, callback
22+
users.find_by_service provider, profile, callback
2223

2324
twitter = new TwitterStrategy
2425
consumerKey: TWITTER_CONSUMER_KEY
@@ -34,4 +35,5 @@ github = new GitHubStrategy
3435

3536
module.exports =
3637
twitter: twitter
37-
github: github
38+
github: github
39+

0 commit comments

Comments
 (0)