Open fenichelar opened 8 years ago
Although storing data in files is very discouraged (even worse if credentials) for a lot of reasons I'm sure you already know, if I understand right you are not in the right place, this plugin has the purpose of giving you an authentication system that works with JWT (json web tokens). Despite the "json" within the name is not what you want it's not about storing data in json.
What you're are searching for (again, not recommended) is just https://github.com/balderdashy/sails-disk that writes data in a file in json format. The intent of the sails-disk is to provide a quick and dirty database during development without firing a real one, but if a file with json is what you want, well, with this plugin is what you get.
hints:
How can I store the list of allowed usernames and passwords in a JSON file? I am using Sails as an API “middleman”. Sails contains no data and makes HTTP requests to receive data from another API server. Sails manipulates the data to be JSON and has a RESTful structure. This makes the interface much easier to implement then the structure of the original API. I also am trying to get Sails to do authentication in place of the server with the data. Because Sails has no data, it also has no database. All of the configuration is stored in JSON files so storing the list of users in a JSON file would keep things consistent. Thanks.