# Settings.js file is not loading while node-red start

**URL:** <https://discourse.nodered.org/t/settings-js-file-is-not-loading-while-node-red-start/31669>\
**Category:** General\
**Created:** [17 August 2020 17:47 UTC](https://discourse.nodered.org/t/settings-js-file-is-not-loading-while-node-red-start/31669 "2020-08-17T17:47:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DevanandBaipotu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/devanandbaipotu/32/27138_2.png) [@DevanandBaipotu](https://discourse.nodered.org/u/DevanandBaipotu)\
**Post date:** [17 August 2020 17:47 UTC](https://discourse.nodered.org/t/settings-js-file-is-not-loading-while-node-red-start/31669/1 "2020-08-17T17:47:28Z")

</div>

Actually, I am trying to do custom authentication in node-red.  
In settings.js file I made change like " adminAuth: require("./user-authentication"), " and created user-authentication.js file created in node-red folder. After that i started node-red, it is showing like " Error loading settings file: /home/devan/.node-red/settings.js "

user-authentication.js --\>

```auto
module.exports = {
   type: "credentials",
   users: function(username) {
       return new Promise(function(resolve) {
           // Do whatever work is needed to check username is a valid
           // user.
           if(username === "test" && password === "password") {
            valid = true;
        }
        else
            valid = false;
           if (valid) {
               // Resolve with the user object. It must contain
               // properties 'username' and 'permissions'
               var user = { username: "admin", permissions: "*" };
               resolve(user);
           } else {
               // Resolve with null to indicate this user does not exist
               resolve(null);
           }
       });
   },
   authenticate: function(username,password) {
       return new Promise(function(resolve) {
           // Do whatever work is needed to validate the username/password
           // combination.
           if (valid) {
               // Resolve with the user object. Equivalent to having
               // called users(username);
               var user = { username: "admin", permissions: "*" };
               resolve(user);
           } else {
               // Resolve with null to indicate the username/password pair
               // were not valid.
               resolve(null);
           }
       });
   },
   default: function() {
       return new Promise(function(resolve) {
           // Resolve with the user object for the default user.
           // If no default user exists, resolve with null.
           resolve({anonymous: true, permissions:"read"});
       });
   }
}

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 August 2020 19:33 UTC](https://discourse.nodered.org/t/settings-js-file-is-not-loading-while-node-red-start/31669/2 "2020-08-17T19:33:26Z")

</div>

As per the guidance for this forum, it helps a lot if you surround your code with backticks so that it becomes readable.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [16 October 2020 19:33 UTC](https://discourse.nodered.org/t/settings-js-file-is-not-loading-while-node-red-start/31669/3 "2020-10-16T19:33:26Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
