What this article will teach you:
How to apply JWT Authentication in your SailsJS v1 backend.
What this article will NOT teach you:
How to cr...
For further actions, you may consider blocking this person and/or reporting abuse
sails generate policy isAuthenticated
When i tried the above command, i got the following error:
error: No generator called
policy
found.Did you mean
sails generate api policy
?Tip: Want to use a custom or community generator?
Add it to your app's .sailsrc file under
modules
:You can use a relative path:
Or the name of an NPM package:
For help, see:
sailsjs.com/docs/concepts/extendin...
Thank you for the feedback!
At the time of this article, I was relying on Sails' Documentation, which currently takes us to a dead link. So it could be that it's changed. I've posted a comment with the updates
Thank you again!
As per @pragathyt95 ,
sails generate policy [policy-name]
is not working. After trying to navigate to Sails' Documentation, it led me to a dead link, which could mean that it's no longer there.The concept and everything else will still work as they should! All what you need to do is manually creating the policy inside
api/policies/<policy_name.js>
Great article, in reference to community, there is a brewing community for Sails at the moment and a platform that will be launching soon to teach Sails sailscasts.com
You can join the community by following this invite
discord.gg/gbJZuNm
We also have a blog dedicated to learning Sails things
blog.sailscasts.com
By the way I wrote a LogRocket article on building a web API with Sails packed with user registration, JWT authentication, email verification and more.
Check it out if you are interested in that sort of thing :)
blog.logrocket.com/building-a-node...
how to run this?
How to run what exactly?
i got it cleared thank u!
Alright Prathika. If there's anything else I can do, let me know!
Thanks for the article, being a sails fan I've been looking for a built in way of automatically handling JWT tokens, this really helps 😀
If there's anything else I can help you with, please let me know!
Hello, there! Thanks for the quick solution.
However, a crucial part is missing here - how do we generate the web tokens at the user level?
Hey there Plamen!
Unfortunately, this article does not have the purpose of teaching how JWT Tokens are generated.
If you'd like, and other people would too, I can create an article that serves that purpose! Let me know and help me get supporters for the purpose!
Thanks for this article it really helped!
If you need anything else make sure to ping me!