Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #13 from syreal17/master
Browse files Browse the repository at this point in the history
Added basic auth to top level of website
  • Loading branch information
syreal17 authored Feb 27, 2020
2 parents faf1288 + d186d52 commit c948d47
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
16 changes: 15 additions & 1 deletion atlas-web-app/config/policies.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@
* https://sailsjs.com/docs/concepts/policies
*/

// Authentication module.
const auth = require('http-auth');
const basic = auth.basic({
realm: "CONIX"
}, (username, password, callback) => {
// Custom authentication
// Use callback(error) if you want to throw async error.
callback(username === "conix" && password === "conix");
}
);
const auth_connect = require('http-auth-connect');


module.exports.policies = {

/***************************************************************************
Expand All @@ -17,6 +30,7 @@ module.exports.policies = {
* *
***************************************************************************/

'*': 'isLocal',
'*': auth_connect(basic),
//'*': 'isLocal',

};
39 changes: 39 additions & 0 deletions atlas-web-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions atlas-web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
"@sailshq/lodash": "^3.10.4",
"@sailshq/socket.io-redis": "^5.2.0",
"grunt": "1.0.4",
"http-auth": "^4.1.2",
"http-auth-connect": "^1.0.4",
"requirejs": "^2.3.6",
"sails": "^1.2.3",
"sails-hook-grunt": "^4.0.0",
"sails-hook-orm": "^2.1.1",
"sails-hook-sockets": "^2.0.0",
"sails-mongo": "^1.0.1",
"uuid": "^3.3.3",
"sails-redis": "^1.0.0"
"sails-redis": "^1.0.0",
"uuid": "^3.3.3"
},
"devDependencies": {
"eslint": "5.16.0"
Expand Down

0 comments on commit c948d47

Please sign in to comment.