mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
logout functionality
This commit is contained in:
parent
26881a3e39
commit
77612cc6fb
@ -17,6 +17,7 @@ module.exports = [
|
||||
{ command: 'group.saveAs', hideDisabled: true },
|
||||
{ divider: true },
|
||||
{ command: 'file.exit', hideDisabled: true },
|
||||
{ command: 'app.logout', hideDisabled: true },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@ -38,10 +38,19 @@ module.exports = {
|
||||
allowShellConnection: platformInfo.allowShellConnection,
|
||||
allowShellScripting: platformInfo.allowShellConnection,
|
||||
permissions,
|
||||
login,
|
||||
...currentVersion,
|
||||
};
|
||||
},
|
||||
|
||||
logout_meta: {
|
||||
method: 'get',
|
||||
raw: true,
|
||||
},
|
||||
logout(req, res) {
|
||||
res.status(401).send('Logged out<br><a href="../..">Back to DbGate</a>');
|
||||
},
|
||||
|
||||
platformInfo_meta: true,
|
||||
async platformInfo() {
|
||||
return platformInfo;
|
||||
|
@ -486,6 +486,16 @@ registerCommand({
|
||||
onClick: () => getElectron().send('close-window'),
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'app.logout',
|
||||
category: 'App',
|
||||
name: 'Logout',
|
||||
testEnabled: () => getCurrentConfig()?.login != null,
|
||||
onClick: () => {
|
||||
window.location.href = 'config/logout';
|
||||
},
|
||||
});
|
||||
|
||||
export function registerFileCommands({
|
||||
idPrefix,
|
||||
category,
|
||||
|
Loading…
Reference in New Issue
Block a user