|
|
@@ -1,6 +1,8 @@
|
|
|
import React from 'react';
|
|
|
import { ThemeProvider, styled, createTheme } from '@mui/material/styles';
|
|
|
import '../Css/user.css'
|
|
|
+import { removeToken } from '../Slices/tokenSlice'
|
|
|
+import { useDispatch } from 'react-redux'
|
|
|
|
|
|
import {
|
|
|
Container, IconButton, Divider,
|
|
|
@@ -82,8 +84,10 @@ export function User() {
|
|
|
const isMovil = Size('(max-width:770px)');
|
|
|
const auth = useAuth();
|
|
|
const navigate = useNavigate()
|
|
|
+ let dispatch = useDispatch()
|
|
|
|
|
|
const CerrarSession = () => {
|
|
|
+ dispatch(removeToken())
|
|
|
auth.logout();
|
|
|
navigate('/logincd')
|
|
|
}
|