fixes
This commit is contained in:
@@ -8,7 +8,7 @@ import { styled } from '@mui/material/styles';
|
||||
import NavigateNextRoundedIcon from '@mui/icons-material/NavigateNextRounded';
|
||||
import CircularProgress from '@mui/material/CircularProgress';
|
||||
import { LatestProps } from "../types/props";
|
||||
import Fade from '@mui/material/Fade'; // ✅ for smooth appearance
|
||||
import Fade from '@mui/material/Fade';
|
||||
|
||||
|
||||
const StyledTypography = styled(Typography)({
|
||||
|
||||
@@ -19,7 +19,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
|
||||
setError(null);
|
||||
|
||||
const res = await api.post('/auth/register', { username, password });
|
||||
return res.data; // returns PublicUser from backend
|
||||
return res.data; // returns PublicUser from the backend
|
||||
} catch (err: any) {
|
||||
console.error('Registration failed:', err);
|
||||
setError(err.response?.data?.detail || 'Registration failed');
|
||||
@@ -109,7 +109,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
|
||||
setCurrentUser(fullUser);
|
||||
} catch (err) {
|
||||
console.error('Failed to fetch current user:', err);
|
||||
logout(); // invalid/expired token
|
||||
logout();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user