johnstonbl01 / clementinejs-fcc Goto Github PK
View Code? Open in Web Editor NEWA version of the Clementine.js boilerplate specifically for use with Free Code Camp curriculum.
Home Page: http://www.clementinejs.com
License: Other
A version of the Clementine.js boilerplate specifically for use with Free Code Camp curriculum.
Home Page: http://www.clementinejs.com
License: Other
After going through the steps and running node server.js
, it ran successfully but clicking the login button, this showed up
Error: socket hang up
at Strategy.OAuth2Strategy._createOAuthError (/home/m4rhy0rh/workspace/project1/node_modules/passport-oauth2/lib/strategy.js:348:17)
at /home/m4rhy0rh/workspace/project1/node_modules/passport-oauth2/lib/strategy.js:171:43
at /home/m4rhy0rh/workspace/project1/node_modules/oauth/lib/oauth2.js:177:18
at ClientRequest.<anonymous> (/home/m4rhy0rh/workspace/project1/node_modules/oauth/lib/oauth2.js:148:5)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at CleartextStream.socketErrorListener (http.js:1547:9)
at CleartextStream.EventEmitter.emit (events.js:95:17)
at SecurePair.<anonymous> (tls.js:1400:15)
at SecurePair.EventEmitter.emit (events.js:95:17)
at SecurePair.error (tls.js:1020:27)
at EncryptedStream.CryptoStream._done (tls.js:705:22)
at CleartextStream.read [as _read] (tls.js:496:24)
at CleartextStream.Readable.read (_stream_readable.js:320:10)
at EncryptedStream.onCryptoStreamFinish (tls.js:301:47)
at EncryptedStream.g (events.js:180:16)
at EncryptedStream.EventEmitter.emit (events.js:117:20)
I tried to write Tutorial #3 over my Tutorial #2 code, integrating AngularJS with Mongoose and Passport. I think I've solved the issue, but to help others avoid the pit I fell into, I spent Christmas Eve bashing my head as to why the code written for Tutorial #2, $resource("/api/clicks") wasn't working in Tutorial #3 as $resource("/api/:id/clicks").
In clickController.client.js, $resource("/api/:id", {id: "@id"}) worked for the $scope.getClicks() function, but in userController.client.js and the other $scope functions, I received the error "http://gbhojraj.c9.io/api/clicks not found". The :id field disappeared in the request URL.
I'm not sure why $resource was able to access the data in $scope.getClicks() and not in POST or any other scopes, but rewriting the code with $http.get("/api/:id").then(function(result){...}; works!
For beginner users, you might want to document that after the repo is cloned, they have to run 'npm install'.
When running the server, the following warning appears.
(node:18225) DeprecationWarning:
open()
is deprecated in mongoose >= 4.11.0, useopenUri()
instead, or set theuseMongoClient
option if usingconnect()
orcreateConnection()
. See http://mongoosejs.com/docs/connections.html#use-mongo-client
This is talked about on the mongoose repo here: Automattic/mongoose#5399
Server.js section in Clementine.js Passport Authentication Tutorial
the directions if followed gives me a deprecation warning if using following code. mongoose.connect('mongodb://localhost:27017/clementinejs');
changing code to following solves this issue.
mongoose.connect('mongodb://localhost:27017/clementinejs', {useMongooseClient: true});
In order for the app to work you must create an app.use() statement in server.js and that is not covered in the fcc tutorial. Please update. Thanks for all your hard work on this. It has been very beneficial.
In the tutorial http://www.clementinejs.com/tutorials/tutorial-passport.html the port is switched from 3000 to 8080, which is mentioned at the top of the tutorial. It would be nice for clarification to put in a note that clickController.client.js apiUrl needs to be changed accordingly, i.e:
var apiUrl = 'http://localhost:3000/api/clicks';
var apiUrl = 'http://localhost:8080/api/clicks';
Other than that small note it was a good tutorial, thanks.
Congratulations on a well-put-together project. I just did a quick trial install on Cloud 9, it likes libkrb5-dev
for Passport and it needs to be told to start mongod
and use port 8080 but other than that, it was pretty smooth. Are there any outstanding tasks you wish people would work on in order to get it ready for wider use?
Edit: note, this was with Node 4.0.0, installed via nvm
.
Hi, any suggestions?
AuthorizationError: The redirect_uri MUST match the registered callback URL for this application.
at Strategy.OAuth2Strategy.authenticate (/home/ubuntu/workspace/node_modules/passport-github/node_modules/passport-oauth2/lib/strategy.js:126:25)
at attempt (/home/ubuntu/workspace/node_modules/passport/lib/middleware/authenticate.js:348:16)
at authenticate (/home/ubuntu/workspace/node_modules/passport/lib/middleware/authenticate.js:349:7)
at Layer.handle [as handle_request] (/home/ubuntu/workspace/node_modules/express/lib/router/layer.js:95:5)
at next (/home/ubuntu/workspace/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/home/ubuntu/workspace/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/ubuntu/workspace/node_modules/express/lib/router/layer.js:95:5)
at /home/ubuntu/workspace/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/home/ubuntu/workspace/node_modules/express/lib/router/index.js:330:12)
at next (/home/ubuntu/workspace/node_modules/express/lib/router/index.js:271:10)
at SessionStrategy.strategy.pass (/home/ubuntu/workspace/node_modules/passport/lib/middleware/authenticate.js:325:9)
at SessionStrategy.authenticate (/home/ubuntu/workspace/node_modules/passport/lib/strategies/session.js:71:10)
at attempt (/home/ubuntu/workspace/node_modules/passport/lib/middleware/authenticate.js:348:16)
at authenticate (/home/ubuntu/workspace/node_modules/passport/lib/middleware/authenticate.js:349:7)
at Layer.handle [as handle_request] (/home/ubuntu/workspace/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/ubuntu/workspace/node_modules/express/lib/router/index.js:312:13)
I've run into a problem with mongoose. Apparently it currently doesn't support Mongodb 3.0. when I loaded clementine to heroku it requires a setup of the Mongolab add-in. Mongolab is supporting only 3.0. When you login using the mongo you will get an authentication error because its gone to a SCRAM-SHA-1 authentication. I'm not sure what the solution to all this will be, but I have a feeling the mongoose api will be different.
I'm trying to log in to the app but I'm getting
TokenError: The code passed is incorrect or expired.
at Strategy.OAuth2Strategy.parseErrorResponse (...\node_modules\passport-oauth2\lib\strategy.js:320:12)
at Strategy.OAuth2Strategy._createOAuthError (...\node_modules\passport-oauth2\lib\strategy.js:367:16)
at ...\node_modules\passport-oauth2\lib\strategy.js:166:45
at ...\node_modules\passport-github\lib\strategy.js:77:16
at ...\node_modules\oauth\lib\oauth2.js:195:7
at passBackControl (...\node_modules\oauth\lib\oauth2.js:125:9)
at IncomingMessage.<anonymous> (...\node_modules\oauth\lib\oauth2.js:143:7)
at emitNone (events.js:85:20)
at IncomingMessage.emit (events.js:179:7)
at endReadableNT (_stream_readable.js:913:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Any ideas regarding this?
Some GitHub users have not set a display name in their profiles. In this case, the /login
page should display the username rather than the display name.
I'm happy to walk a beginner making his or her first pull request through making this change.
according to clemintine README.md file when downloading the boilerplate via command
git clone https://github.com/johnstonbl01/clementinejs-fcc.git your-project
I am to go to http://www.clementinejs.com/tutorials/tutorial-passport.html#GitHubAppSetup
Head to GitHub and log in.
Instruction should read instead!
fill out form cont...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.