Errores en servicio de autenficación solucionados.
This commit is contained in:
parent
245112438e
commit
9ebd705aea
|
@ -10,7 +10,7 @@ module.exports = function(app) {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post('/login', function(req, res) {
|
app.post('/login', function(req, res) {
|
||||||
let user = req.body.user;
|
let user = req.body.user ? req.body.user : "";
|
||||||
let password = req.body.password;
|
let password = req.body.password;
|
||||||
let syncOnFail = true;
|
let syncOnFail = true;
|
||||||
let usesEmail = user.indexOf('@') !== -1;
|
let usesEmail = user.indexOf('@') !== -1;
|
||||||
|
@ -38,15 +38,24 @@ module.exports = function(app) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let query = url.parse(req.body.location, true).query;
|
let parsedLocation;
|
||||||
let loginUrl = applications[query.apiKey];
|
let loginUrl;
|
||||||
|
let shouldContinue = false;
|
||||||
|
|
||||||
|
if (req.body.location)
|
||||||
|
parsedLocation = url.parse(req.body.location, true);
|
||||||
|
|
||||||
|
if (parsedLocation && parsedLocation.query) {
|
||||||
|
loginUrl = applications[parsedLocation.query.apiKey];
|
||||||
|
shouldContinue = parsedLocation.query.continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!loginUrl)
|
if (!loginUrl)
|
||||||
loginUrl = applications.default;
|
loginUrl = applications.default;
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
token: token.id,
|
token: token.id,
|
||||||
continue: query.continue,
|
continue: shouldContinue,
|
||||||
loginUrl: loginUrl
|
loginUrl: loginUrl
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue