mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 04:45:56 +00:00
feat(client): allows to redirect to specific url after signout (#5583)
This commit is contained in:
parent
d68c671a12
commit
9fd136b331
@ -139,8 +139,12 @@ export const SettingsMenu: React.FC<{
|
||||
key: 'signout',
|
||||
label: t('Sign out'),
|
||||
onClick: async () => {
|
||||
await api.auth.signOut();
|
||||
navigate(`/signin?redirect=${encodeURIComponent(redirectUrl)}`);
|
||||
const { data } = await api.auth.signOut();
|
||||
if (data?.data?.redirect) {
|
||||
window.location.href = data.data.redirect;
|
||||
} else {
|
||||
navigate(`/signin?redirect=${encodeURIComponent(redirectUrl)}`);
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user