Podpora odhlášení přes Authelia

This commit is contained in:
2023-08-08 21:32:11 +02:00
parent 6b824ce33a
commit d41e0e9113
4 changed files with 11 additions and 1 deletions

View File

@@ -46,8 +46,13 @@ function useProvideAuth(): AuthContextProps {
}, [decodedToken]);
function logout() {
const trusted = (decodedToken as any).trusted;
const logoutUrl = (decodedToken as any).logoutUrl;
setToken(null);
setLoginName(undefined);
if (trusted && logoutUrl?.length) {
window.location.replace(logoutUrl);
}
}
return {