Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (33 sloc) 1.12 KB
express = require 'express'
everyauth = require 'everyauth'
everyauth.debug = true;
options =
host: 'http://localhost:3000' # change this
id: '-- client id --' # change this
secret: '-- client secret --' # change this
current = token = null
everyauth.foursquare.redirectPath '/'
everyauth.foursquare.appSecret options.secret
everyauth.foursquare.findOrCreateUser (session, accessToken, accessTokenExtra, user) ->
[token, current] = [accessToken, user]
app = express.createServer()
app.use express.bodyParser()
app.use express.cookieParser()
app.use express.session secret: 'node-4sq'
app.use everyauth.middleware()
app.set 'views', __dirname + '/views'
app.set 'view engine', 'ejs'
app.set 'view options', layout: false
app.get '/', (request, response) ->
if not request.loggedIn
response.render 'login'
response.render 'result'
name: current.firstName + ' ' + current.lastName
token: token
everyauth.helpExpress app
app.listen 3000
console.log 'Go to ' +
You can’t perform that action at this time.