This commit is contained in:
2022-12-17 01:33:17 +01:00
parent 6c48baac3d
commit 566573f441
2 changed files with 11 additions and 11 deletions

View File

@ -13,13 +13,13 @@ require __DIR__.'/classes/lib.php';
$db_connection = new Database(); $db_connection = new Database();
$conn = $db_connection->dbConnection(); $conn = $db_connection->dbConnection();
$data = json_decode(file_get_contents("php://input")); //$data = json_decode(file_get_contents("php://input"));
// $data = json_decode( $data = json_decode(
// '{ '{
// "email": "a@a.a", "email": "a@q.q",
// "password": "qwertzui" "password": "qwertzui"
// }' }'
// ); );
$returnData = new CMsg(0); $returnData = new CMsg(0);
// IF REQUEST METHOD IS NOT EQUAL TO POST // IF REQUEST METHOD IS NOT EQUAL TO POST

View File

@ -84,10 +84,10 @@ export const UserCtxProvider = ({children}:TUserContextProviderProps) => {
{ {
success: number; success: number;
message: string; message: string;
user: TUser | null; data: TUser | null;
} }
} }
= { data : {success: 0, message: '', user: null } }; = { data : {success: 0, message: '', data: null } };
@ -98,9 +98,9 @@ export const UserCtxProvider = ({children}:TUserContextProviderProps) => {
}); });
const {data} = postReturn; const {data} = postReturn;
if(data.success && data.user) if(data.success && data.data)
{ {
setUser(data.user); setUser(data.data);
setWait(false); setWait(false);
return {success:1}; return {success:1};
} }