Изменен порядок авторизации

This commit is contained in:
Kayashov.SM
2025-08-23 23:52:04 +04:00
parent 10634242e4
commit 91770b99b7
2 changed files with 5 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ import {useAuth} from "../../hooks/useAuth";
import {api} from "../../lib/clients/api"; import {api} from "../../lib/clients/api";
const emptyRequest = { const emptyRequest = {
byLogin: false, byLogin: true,
code: "", code: "",
login: "", login: "",
password: "" password: ""
@@ -25,7 +25,7 @@ export function SignInForm() {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [error, setError] = useState(null); const [error, setError] = useState(null);
const [request, setRequest] = useState(emptyRequest); const [request, setRequest] = useState(emptyRequest);
const [pass, setPass] = useState(false) const [pass, setPass] = useState(true)
const {checkSession} = useAuth(); const {checkSession} = useAuth();
const buttonSx = { const buttonSx = {

View File

@@ -85,6 +85,9 @@ export function UserPopover({anchorEl, onClose, open}) {
} }
function userDescriptor(user) { function userDescriptor(user) {
if(!user) {
return null;
}
if (!user.name) { if (!user.name) {
return (<Typography variant="subtitle1">Гость</Typography>); return (<Typography variant="subtitle1">Гость</Typography>);
} }