Connor
Connor

Reputation: 4168

Authenticating via Github (using everyauth)

I'm using everyauth, and am having trouble authenticating it with github. It seems like all of the steps I've followed thus far are correct, but it keeps telling me it cannot GET /auth/github when clicking the "connect with github" link.

Here's a gist with my code: https://gist.github.com/2641260

Any help would be greatly appreciated!

Upvotes: 1

Views: 367

Answers (2)

Arjun Bajaj
Arjun Bajaj

Reputation: 1962

I know its probably too late to answer, but I just had the same problem and figured out the solution.

Its really simple.

Place the EveryAuth code before the app.configure() code.

This way: Fork of your Gist

Upvotes: 1

steve
steve

Reputation: 128

Not sure if this will help but have you tried adding the ".entryPath" chainable parameter?

everyauth.github
    .entryPath('/auth/github')
    .appId("APP_ID")
    .appSecret("APP_SECRET")
    .findOrCreateUser( function (sess, accessToken, accessTokenExtra, ghUser) {
  console.log('find user')
  // return usersByGhId[ghUser.id] || (usersByGhId[ghUser.id] = addUser('github', ghUser));
  })
 .redirectPath('/');

Upvotes: 0

Related Questions