ragulka / sails-starter-app Goto Github PK
View Code? Open in Web Editor NEWSails starter app
Sails starter app
Creating a user according to the tutorial does not work unless one removes the _csrf value. This is the traceback:
TypeError: Cannot read property '1' of null
at Object.isSameOrigin (/home/kokujin/sails/starterapp/node_modules/sails/lib/util/index.js:256:70)
at routes.before./* (/home/kokujin/sails/starterapp/node_modules/sails/lib/hooks/csrf/index.js:23:60)
at _bind.enhancedFn (/home/kokujin/sails/starterapp/node_modules/sails/lib/router/bind.js:375:4)
at callbacks (/home/kokujin/sails/starterapp/node_modules/sails/node_modules/express/lib/router/index.js:164:37)
at param (/home/kokujin/sails/starterapp/node_modules/sails/node_modules/express/lib/router/index.js:138:11)
at pass (/home/kokujin/sails/starterapp/node_modules/sails/node_modules/express/lib/router/index.js:145:5)
at nextRoute (/home/kokujin/sails/starterapp/node_modules/sails/node_modules/express/lib/router/index.js:100:7)
at callbacks (/home/kokujin/sails/starterapp/node_modules/sails/node_modules/express/lib/router/index.js:167:11)
at _addResViewMethod (/home/kokujin/sails/starterapp/node_modules/sails/lib/hooks/views/index.js:337:3)
at _bind.enhancedFn (/home/kokujin/sails/starterapp/node_modules/sails/lib/router/bind.js:375:4)
Am I allowed to use this base for a commercial application?
Hi @ragulka , your project is amazing and help me a lot. Sails have just released new version 0.10.1 few days ago. Do you have plan to upgrade your project?
Hi thank you for creating this.
I am getting the following error on "sails lift". What am I missing?
/Users/ramirez/apps/projects/node/sails-starter-app/api/models/Email.js:20
name: sails.config.mail.from.name,
^
TypeError: Cannot read property 'mail' of undefined
How to run the worker (job processor)?
Hi, do you think is possible to show the KUE UI inside a sails app?
Maybe as a mounted app?
Doesn't even go past npm install. Pff!
/Users/alenail/Documents/bluemoon/sails-starter-app/api/services/Mailer.js:12
host: sails.config.smtp.host,
^
TypeError: Cannot read property 'host' of undefined
What do you make of this? I cloned, npm installed, started mongo, and tried to sails lift.
throws a hell of errors at me ;-)
debug-log:
https://gist.github.com/michapixel/5037069
Hello,
thanks a lot for this starter app. In order to understand correctly what you did, I created a blank sails app and copied your User model and user unit test and configured the test with grunt-mocha-test.
When running the test, it seems that beforeCreate is not called (so no encrypedPassword is done). Any idea what can cause this ?
User Model:
Password encryption
for a new user
1) must encrypt the password
for an existing user
if the password was changed
2) must encrypt the new password
if the password was not changed
3) must not try to encrypt the password
Password validation
given a valid password
4) must return true
given an invalid password
5) must return false
Session tokens
#issueSessionToken()
6) must persist a session token in database
#consumeSessionToken()
7) must return the user object and discard the token
API Key
8) must be generateted for a new user
.fullName()
given first name only
✓ must return first name only, no trailing space
given last name only
✓ must return last name only, no preceeding space
given both first and last name
✓ must return the full name
given neither first or last name
✓ must return empty string
.generatePasswordResetToken()
9) "before all" hook
4 passing (887ms)
9 failing
Also, In the User model, you redefined the toJSON method:
toJSON: function() {
var user = this.toObject();
delete user.password;
delete user.passwordConfirmation;
delete user.encryptedPassword;
delete user.sessionTokens;
delete user._csrf;
return user;
},
But there are no password nor passwordConfirmation within the User model.
Any ideas why the unit test does not pass ?
Hi, awesome work on putting together a starter app for sails that includes authentication! Its definitely something thats lacking and for someone who's new to a full stack JS dev environment its extremely helpful. Was wondering about whether or not you're still planning on adding API-key based authentication? I'm extremely interested in how that might be implemented as I'm currently working on an Angular-Sails based app through which the client side interacts exclusively with the server using API REST calls. There aren't a lot of good resources online for implementing this kind of thing so I'm eagerly awaiting any light you might be able to shed on the issue.
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.