1
0
Fork 0

renamed config property names

This commit is contained in:
Ruben Meyer 2020-01-12 21:37:16 +01:00
parent 6bc814bd50
commit a3fe0e0091
3 changed files with 7 additions and 14 deletions

View File

@ -19,7 +19,7 @@ module.exports = {
},
sso: {
authenticator: "http://localhost:8080/api/authenticate", // redirect back to this url;
redirectUser: "https://auth.rxbn.de/authenticate", // sso service
provider: "https://auth.rxbn.de/authenticate", // sso service
appId: process.env.APP_ID, // app id
appSecret: process.env.APP_SECRET // random token
},

View File

@ -21,7 +21,7 @@ functions.authenticateUser = (obj, callback) => {
request({
method: 'POST',
uri: global['gds'].cfg.sso.authenticator,
uri: global['gds'].cfg.sso.provider,
headers: {
'Content-Type': 'application/json'
},
@ -55,7 +55,7 @@ functions.createAuthentication = (obj) => {
redirectUrl: obj.url,
appId: obj.appId
};
return global['gds'].cfg.sso.redirectUser+"?"+querystring.stringify(nUrl);
return global['gds'].cfg.sso.provider+"?"+querystring.stringify(nUrl);
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -1,25 +1,18 @@
var express = require('express');
var route = express.Router();
route.get('/register', (req, res) => {
if(!global['gds'].cfg.web.registration) {
return res.type('json').status(400).end(JSON.stringify({status: 400, message: "msg.auth.registration.deactivated"}));
}
// TODO: register
});
route.get('/login', (req, res) => {
// TODO: login
let a = global['modules'].sso.createAuthentication({
url: global['gds'].cfg.sso.authenticator,
appId: global['gds'].cfg.sso.appId
})
console.log(a);
res.end('login');
});
res.redirect(a);
});
route.post('/authenticate', (req, res) => {
route.get('/authenticate', (req, res) => {
// TODO: authenticate
res.end();
});
route.get('/logout', (req, res) => {