mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #3269 from node-red/auth-id
Include full user object on login audit events
This commit is contained in:
commit
46b6b024b9
@ -141,7 +141,7 @@ function completeVerify(profile,done) {
|
|||||||
Users.authenticate(profile).then(function(user) {
|
Users.authenticate(profile).then(function(user) {
|
||||||
if (user) {
|
if (user) {
|
||||||
Tokens.create(user.username,"node-red-editor",user.permissions).then(function(tokens) {
|
Tokens.create(user.username,"node-red-editor",user.permissions).then(function(tokens) {
|
||||||
log.audit({event: "auth.login",username:user.username,scope:user.permissions});
|
log.audit({event: "auth.login",user,username:user.username,scope:user.permissions});
|
||||||
user.tokens = tokens;
|
user.tokens = tokens;
|
||||||
done(null,user);
|
done(null,user);
|
||||||
});
|
});
|
||||||
|
@ -93,7 +93,7 @@ var passwordTokenExchange = function(client, username, password, scope, done) {
|
|||||||
return logEntry.user !== username;
|
return logEntry.user !== username;
|
||||||
});
|
});
|
||||||
Tokens.create(username,client.id,scope).then(function(tokens) {
|
Tokens.create(username,client.id,scope).then(function(tokens) {
|
||||||
log.audit({event: "auth.login",username:username,client:client.id,scope:scope});
|
log.audit({event: "auth.login",user,username:username,client:client.id,scope:scope});
|
||||||
done(null,tokens.accessToken,null,{expires_in:tokens.expires_in});
|
done(null,tokens.accessToken,null,{expires_in:tokens.expires_in});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user