zemirco / lockit

Authentication solution for Express
439 stars 48 forks source link

How to run the couchdb example? #34

Closed Esauromano closed 9 years ago

Esauromano commented 9 years ago

I have tried asin this post http://stackoverflow.com/questions/25320313/couchdb-with-nodejs-authentication-solution and as the instructions on the readme, and i cant keep it running

Esauromano commented 9 years ago

If i run the quickstart as it is in the readme, it does not work:

and this results as an error

GET /signup 200 283.528 ms - 1122 GET /stylesheets/style.css 200 7.560 ms - 110 Executing (default): SELECT * FROM my_user_table WHERE my_user_table.name='esau' LIMIT 1; Executing (default): SELECT * FROM my_user_table WHERE my_user_table.email='esauromano@gmail.com' LIMIT 1; Executing (default): INSERT INTO my_user_table (name,email,derived_key,salt,signupToken,signupTimestamp,signupTokenExpires,failedLoginAttempts) VALUES ('esau','esauromano@gmail.com','035136be77cd80ca8fe343af8fe3e4ce4267c674','77dd3afcf911e73dabc50a4cbdc4423a','45641387-d2cd-461f-ab55-b02f0050b5bb','2015-05-18 23:57:25.805 +00:00','2015-05-19 23:57:25.806 +00:00',0); Executing (default): SELECT * FROM my_user_table WHERE my_user_table.email='esauromano@gmail.com' LIMIT 1;

/root/MenuAut/node_modules/lockit/node_modules/sqlite3/lib/trace.js:28 throw err; ^ Error: Cannot find module 'lockit-template-blank' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at new module.exports (/root/MenuAut/node_modules/lockit/node_modules/lockit-signup/node_modules/lockit-sendmail/index.js:15:19) at /root/MenuAut/node_modules/lockit/node_modules/lockit-signup/index.js:179:20 at null. (/root/MenuAut/node_modules/lockit/node_modules/lockit-sql-adapter/index.js:135:13) at emit (events.js:95:17) at module.exports.CustomEventEmitter.emit (/root/MenuAut/node_modules/lockit/node_modules/lockit-sql-adapter/node_modules/sequelize/lib/emitters/custom-event-emitter.js:61:33) at null. (/root/MenuAut/node_modules/lockit/node_modules/lockit-sql-adapter/node_modules/sequelize/lib/query-interface.js:981:19) --> in Database#all('SELECT * FROM my_user_table WHERE my_user_table.email=\'esauromano@gmail.com\' LIMIT 1;', [Function]) at executeSql (/root/MenuAut/node_modules/lockit/node_modules/lockit-sql-adapter/node_modules/sequelize/lib/dialects/sqlite/query.js:43:54) at /root/MenuAut/node_modules/lockit/node_modules/lockit-sql-adapter/node_modules/sequelize/node_modules/lodash/dist/lodash.js:5144:23

Esauromano commented 9 years ago

this is kinda odd isn't it?

root@TMx:~/MenuAut/MEnu# npm install lockit cookie-session --save npm WARN deprecated sequelize@1.7.10: critical security fix in v3.0.0

sqlite3@3.0.8 install /root/MenuAut/MEnu/node_modules/lockit/node_modules/sqlite3 node-pre-gyp install --fallback-to-build

[sqlite3] Success: "/root/MenuAut/MEnu/node_modules/lockit/node_modules/sqlite3/lib/binding/node-v11-linux-x64/node_sqlite3.node" is installed via remote npm WARN deprecated lingo@0.0.5: This project is abandoned cookie-session@1.1.0 node_modules/cookie-session ├── on-headers@1.0.0 └── cookies@0.5.0 (keygrip@1.0.1)

zemirco commented 9 years ago

Check out the couchdb example from the ./examples/couchdb folder. Run npm install to install all dependencies. You need to have a CouchDB running at http://127.0.0.1:5984/.

The error message shows that you haven't told lockit to use CouchDB. Looks like your lockit uses the default configuration and tries to connect to an in-memory sqlite database.

zemirco commented 9 years ago

Were you able to solve your problem?

Esauromano commented 8 years ago

Yours run like a charm!!!