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,9 +159,13 @@ RED.user = (function() {
|
|||||||
url: "auth/revoke",
|
url: "auth/revoke",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: {token:RED.settings.get("auth-tokens").access_token},
|
data: {token:RED.settings.get("auth-tokens").access_token},
|
||||||
success: function() {
|
success: function(data) {
|
||||||
RED.settings.remove("auth-tokens");
|
RED.settings.remove("auth-tokens");
|
||||||
document.location.reload(true);
|
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
|
// TODO: audit log
|
||||||
Tokens.revoke(token).then(function() {
|
Tokens.revoke(token).then(function() {
|
||||||
log.audit({event: "auth.login.revoke"},req);
|
log.audit({event: "auth.login.revoke"},req);
|
||||||
res.status(200).end();
|
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