Skip to content

Commit

Permalink
fixed broken calls. Not actually working though
Browse files Browse the repository at this point in the history
  • Loading branch information
dynajoe committed Mar 11, 2012
1 parent 50418fc commit 204552b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 0 additions & 3 deletions app.coffee
Expand Up @@ -35,9 +35,6 @@ controllers.site.use app
controllers.code.use app
controllers.event.use app

app.get '/generate', bitly.generate, (req, res) ->
res.render 'layout', res.data

app.listen port

console.log 'server listening on port ' + port
3 changes: 3 additions & 0 deletions collections/users.coffee
Expand Up @@ -2,6 +2,9 @@ StoredCollection = require '../data/storedCollection'

class Users extends StoredCollection
constructor: () -> super

find_by_service: (provider, id, callback) ->
@find { provider: provider, id: id }, callback

find: () ->
if arguments.length is 1
Expand Down
9 changes: 6 additions & 3 deletions config/strategies.coffee
@@ -1,7 +1,7 @@
url = require 'url'
GitHubStrategy = require('passport-github').Strategy
TwitterStrategy = require('passport-twitter').Strategy
user = require '../models/user'
Users = require '../collections/users'

TWITTER_CONSUMER_KEY = process.env.TWITTER_CONSUMER_KEY || 'notvalidkey'
TWITTER_CONSUMER_SECRET = process.env.TWITTER_CONSUMER_SECRET || 'notvalidkey'
Expand All @@ -11,11 +11,14 @@ GITHUB_CLIENT_ID = process.env.GITHUB_CLIENT_ID || 'notvalidkey'
GITHUB_CLIENT_SECRET = process.env.GITHUB_CLIENT_SECRET || 'notvalidkey'
GITHUB_CALLBACK_URL = url.resolve process.env.CALLBACK_BASE_URL, '/auth/github/callback'


twitterDone = (accessToken, tokenSecret, profile, callback) ->
user.find_by_service 'twitter', profile.id, callback
users = new Users()
users.find_by_service 'twitter', profile.id, callback

githubDone = (accessToken, tokenSecret, profile, callback) ->
user.find_by_service 'github', profile.id, callback
users = new Users()
users.find_by_service 'github', profile.id, callback

twitter = new TwitterStrategy
consumerKey: TWITTER_CONSUMER_KEY
Expand Down

0 comments on commit 204552b

Please sign in to comment.