mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add editorTheme.logout.redirect to allow redirect on logout
Closes #1213
This commit is contained in:
parent
05878d3176
commit
5cb37148c6
@ -159,10 +159,14 @@ RED.user = (function() {
|
||||
url: "auth/revoke",
|
||||
type: "POST",
|
||||
data: {token:RED.settings.get("auth-tokens").access_token},
|
||||
success: function() {
|
||||
success: function(data) {
|
||||
RED.settings.remove("auth-tokens");
|
||||
if (data && data.redirect) {
|
||||
document.location.href = data.redirect;
|
||||
} else {
|
||||
document.location.reload(true);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,11 @@ function revoke(req,res) {
|
||||
// TODO: audit log
|
||||
Tokens.revoke(token).then(function() {
|
||||
log.audit({event: "auth.login.revoke"},req);
|
||||
if (settings.editorTheme && settings.editorTheme.logout && settings.editorTheme.logout.redirect) {
|
||||
res.json({redirect:settings.editorTheme.logout.redirect});
|
||||
} else {
|
||||
res.status(200).end();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user