Podpora odhlášení přes Authelia
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user