Fix createUser endpoint

This commit is contained in:
BitHeaven 2024-08-09 21:51:17 +05:00
parent b844041ea9
commit 755784a870
1 changed files with 2 additions and 2 deletions

View File

@ -1,12 +1,12 @@
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST') {
if(strlen($password) < 8) {
if(strlen($_REQUEST['password']) < 8) {
$data = [
'error' => true,
'message' => 'Пароль должен иметь 8 символов минимум',
];
}
elseif(!User::create($login, $password)) {
elseif(!User::create($_REQUEST['login'], $_REQUEST['password'])) {
$data = [
'error' => true,
'message' => 'Пользователь с таким логином уже сужествует',