sails-auth failing to create models, policies, and other essential resources

After setting up a fresh Sails application, my intention was to incorporate passport for authentication. However, using sails-auth doesn't seem to generate the necessary files as indicated in the documentation.

Sails version: 0.12.14

During the installation of sails-auth, I received a deprecated warning:

newmacs-iMac:dn dev$ npm install sails-auth --save  
npm WARN deprecated gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js

Answer №1

To get started, please refer to the instructions provided on https://github.com/trailsjs/sails-auth

Begin by executing npm install sails-auth --save and then proceed with installing a password strategy of your choice, such as

npm install passport-google-oauth
Next, create a file named config/passport.js containing the appropriate content based on the passport strategy you have decided to implement. Here is an example:

module.exports.passport = {
  local: {
    strategy: require('passport-local').Strategy
  },

  basic: {
    strategy: require('passport-http').BasicStrategy,
    protocol: 'basic'
  }
};

Additional examples are available at https://github.com/trailsjs/sails-auth/blob/master/config/passport.js

Proceed to create config/auth.js

bcrypt: {
    /**
     * Specify the number of salt rounds to apply to the password. Values greater than 10 may result in slower performance.
     */
    rounds: 8
  }

You can now authenticate through /auth/local or /auth/google, depending on the chosen passport strategy.

Note: It appears that with sails v1.0, sails-auth no longer functions correctly. However, since you are utilizing sails 0.12, it should still work as expected.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Encountering a problem trying to install the mongodb module for nodejs

I am currently running node version 0.10.28 Whenever I try to run node-gyp install, it gets stuck and I can't proceed with anything else. I'm trying to install the mongodb driver for node.js (npm install mongodb). However, it's asking me t ...

Guide to combining an Angular 2 (angular-cli) application with Sails.js

I am looking to integrate the app created using angular-cli with Sails.js. My background is in PHP, so I am new to both of these frameworks. What are the steps involved in setting them up together? How can I execute commands like ng serve and/or sails li ...

What sets apart Node Package from Bower Package?

Consider the Ember App as an example. When you run ember install ember-bootstrap-4, it adds a node package. However, executing bower install tether --save will add a bower package. Both packages are necessary for the app. But what is the reason behind on ...

Major issue still remains unresolved with npx create-react-app

Every time I try to create a new React app with npx create-react-app my-app, I encounter a huge problem. Despite completely deleting Node, npm, and npx twice, re-downloading them, and ensuring that my $PATH is set to usr/local/bin, I am still faced with th ...

What is preventing me from running the npm run dev command? (node.js/express.js/typescript)

I'm having trouble running npm run dev for my project (Node.js / Express.js / Typescript). I've followed the instructions in the links below but I still keep getting errors. PS C:\Users\Yasser\Documents\WorkspaceNodeJS\M ...

What is the most effective strategy for managing dependencies for npm packages?

I am currently working on extracting a few Vue.js components from the main application and converting them into an npm package stored in a repository. This package will be imported and utilized across two different websites. To bundle everything, I am util ...

Encountered a build failure caused by conflicts amongst my dependencies

I'm encountering a build error and need assistance with the following issue: Failed to compile ./node_modules/material-ui-search-bar/lib/components/SearchBar/SearchBar.js Module not found: Can't resolve '@material-ui/core/IconButton' i ...

The CircleCI module has not been installed on this system

I am encountering an issue on Circle CI where a container goes through all tests and performs an npm install to download all packages listed in the package.json. However, it appears that some packages are not being installed correctly, leading to a failure ...

Error message while attempting to install Apache Cordova: cordova command not located

I'm facing some challenges while attempting to set up and activate apache cordova on my computer using the command line instructions provided here: After successfully installing nodejs (v0.10.15) and npm (1.2.18), I encountered a partial success with ...

Leveraging npm packages within a Meteor project through cosmos:browserify

Trying to implement Radium, a JavaScript library for inline CSS, by following the instructions located here. In my app.browserify.js file: Radium = require("radium"); Within package.json: "radium": "0.13.4" Upon attempting to utilize Radium in the app&a ...

Steps for creating an NPM package setup

I am in the process of developing my first node.js package aimed at simplifying the usage of a REST API. However, I am encountering difficulties in configuring the package to allow users to seamlessly implement the following functionality within their appl ...

Issue with Webpack - npm run start and build operation not functioning?

Although I typically use create-react-app for my React projects, I decided to create one without it. However, I am encountering issues with the webpack configuration as I am not very familiar with it: This is how my package.json file looks like: { " ...

Creating a NodeJS package that automatically compiles C++/WebAssembly during installation

What is the best way to structure a NodeJS package that includes wrapped C++ code compiled into web assembly? How can we ensure that the compilation step takes place when using npm install <package name>? I have developed a package called mypackage ...

I encountered an issue with the proxy configuration while working with Npm and Angular, specifically after installing and then uninstalling

Ever since I removed Fiddler, I've been encountering issues with using Angular and npm, specifically related to proxy errors. When attempting an http call with Angular, I receive the following error: [HPM] Error occurred while trying to proxy reque ...

I am encountering some difficulties in the installation process of Angular CLI

Encountering an error trying to install angular cli despite updating both node and npm. https://i.stack.imgur.com/SpkNU.jpg ...

Error received on Node.js controller when calling Jquery getJSON from Ajax form

I have a Node.js / Sails.js application with a client-side form that submits to a Controller using jQuery ajax: $(function () { $("form").submit(function (e) { e.preventDefault(); var form = $(this); $.ajax({ url: ...

Encountering an error while including ngmin in the r.js build file

Currently, I am attempting to utilize ngmin with requirejs's r.js as outlined in a guide found here. Unfortunately, I have encountered issues and cannot seem to make it work. Despite installing both ngmin and requirejs globally and locally using npm, ...

ESLint Troubles

Encountering an error when running ESLint despite trying Babel and eslint-parser. Looking for clarification on a particular file without any accompanying documentation. node_modules/eslint-plugin-jsdoc/dist/rules/informativeDocs.js:95 descriptionReport ...

Node.js and TestCafe encountered a critical error: Inefficient mark-compacts were performed near the heap limit, resulting in an allocation failure. The JavaScript heap ran

While executing my test scripts in Node v14.6.0, I encountered the following problem. Here are some of the options I've tried: I attempted to increase the Node Heap Size but unfortunately had no success: export NODE_OPTIONS=--max_old_space_size=4096 ...

Encountering a problem with deploying a sails.js application on Heroku due to an npm error related to the package "sailshq

Starting with the current setup on my development machine: Node version: 8.4.0 Npm: 5.3.0 (includes Node 8.4) Sails: ~0.12.13 Source control system: Github Deployment host: Heroku I followed this guide: (excluding the heroku git part, utilizing githu ...