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) {
|
||||
let user = req.body.user;
|
||||
let user = req.body.user ? req.body.user : "";
|
||||
let password = req.body.password;
|
||||
let syncOnFail = true;
|
||||
let usesEmail = user.indexOf('@') !== -1;
|
||||
|
@ -38,15 +38,24 @@ module.exports = function(app) {
|
|||
return;
|
||||
}
|
||||
|
||||
let query = url.parse(req.body.location, true).query;
|
||||
let loginUrl = applications[query.apiKey];
|
||||
let parsedLocation;
|
||||
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)
|
||||
loginUrl = applications.default;
|
||||
|
||||
res.json({
|
||||
token: token.id,
|
||||
continue: query.continue,
|
||||
continue: shouldContinue,
|
||||
loginUrl: loginUrl
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue