parent
73d09bc99c
commit
f71817b0a2
1 changed files with 11 additions and 2 deletions
|
@ -252,10 +252,19 @@ export const ClientProvider: FC<Props> = ({ children }) => {
|
||||||
[client]
|
[client]
|
||||||
);
|
);
|
||||||
|
|
||||||
const logout = useCallback(() => {
|
const logout = useCallback(async () => {
|
||||||
|
await client.logout(undefined, true);
|
||||||
clearSession();
|
clearSession();
|
||||||
|
setState({
|
||||||
|
client: undefined,
|
||||||
|
loading: false,
|
||||||
|
isAuthenticated: false,
|
||||||
|
isPasswordlessUser: true,
|
||||||
|
userName: "",
|
||||||
|
error: undefined,
|
||||||
|
});
|
||||||
history.push("/");
|
history.push("/");
|
||||||
}, [history]);
|
}, [history, client]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// To protect against multiple sessions writing to the same storage
|
// To protect against multiple sessions writing to the same storage
|
||||||
|
|
Loading…
Add table
Reference in a new issue