Log event for external login

This commit is contained in:
Johannes Zellner
2016-06-07 11:59:54 +02:00
parent d880731351
commit 207e81345f
+5 -2
View File
@@ -422,9 +422,12 @@ var authorization = [
if (type === clients.TYPE_ADMIN) {
eventlog.add(eventlog.ACTION_USER_LOGIN, auditSource(req, 'admin'), { userId: req.oauth2.user.id });
return next();
} else if (type === clients.TYPE_EXTERNAL) {
eventlog.add(eventlog.ACTION_USER_LOGIN, auditSource(req, 'external'), { userId: req.oauth2.user.id });
return next();
} else if (type === clients.TYPE_SIMPLE_AUTH) {
return sendError(req, res, 'Unknown OAuth client.');
}
if (type === clients.TYPE_EXTERNAL) return next();
if (type === clients.TYPE_SIMPLE_AUTH) return sendError(req, res, 'Unknown OAuth client.');
appdb.get(req.oauth2.client.appId, function (error, appObject) {
if (error) return sendErrorPageOrRedirect(req, res, 'Invalid request. Unknown app for this client_id.');