claudioc / jingo

Node.js based Wiki
MIT License
1.02k stars 183 forks source link

Add support for github enterprise #145

Closed everpcpc closed 7 years ago

everpcpc commented 8 years ago

see also: https://github.com/jaredhanson/passport-github/blob/master/lib/strategy.js#L53

passport-github allows passing these options to support a private github enterprise instance.

everpcpc commented 8 years ago

But there seems something wrong using the github enterprise auth. (While the default github.com works well.) I ran an auth procedure, the request logs is as follows: (I disabled the anonRead)

GET / 302 3.722 ms - 64
GET /wiki/Home 302 2.544 ms - 56
GET /login 304 354.384 ms - -
GET /auth/github 302 4.086 ms - 0
GET /auth/github/callback?code=xxxxxxxxxxxxx 302 1170.624 ms - 64
GET /auth/done 302 5.527 ms - 46
GET / 302 1.916 ms - 64
GET /wiki/Home 302 3.384 ms - 56
GET /login 304 209.308 ms - -

It seems the /auth/github/callback got the correct user but did not set it in the request, so _getAuthDone() got an undefined 'res.locals.user' . I believe it's a issue with passport-github or passport.

everpcpc commented 7 years ago

close for https://github.com/claudioc/jingo/pull/186