From 566573f4419efb4a38ecfe7f58d71764bf3ff6d8 Mon Sep 17 00:00:00 2001 From: Peter Hoppe Date: Sat, 17 Dec 2022 01:33:17 +0100 Subject: [PATCH] jaja --- php/php-dog/login.php | 14 +++++++------- src/context/UserContext.tsx | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/php/php-dog/login.php b/php/php-dog/login.php index 7a83f46..1d4ec67 100644 --- a/php/php-dog/login.php +++ b/php/php-dog/login.php @@ -13,13 +13,13 @@ require __DIR__.'/classes/lib.php'; $db_connection = new Database(); $conn = $db_connection->dbConnection(); -$data = json_decode(file_get_contents("php://input")); -// $data = json_decode( -// '{ -// "email": "a@a.a", -// "password": "qwertzui" -// }' -// ); +//$data = json_decode(file_get_contents("php://input")); +$data = json_decode( + '{ + "email": "a@q.q", + "password": "qwertzui" + }' +); $returnData = new CMsg(0); // IF REQUEST METHOD IS NOT EQUAL TO POST diff --git a/src/context/UserContext.tsx b/src/context/UserContext.tsx index 1f6f589..e09d3af 100644 --- a/src/context/UserContext.tsx +++ b/src/context/UserContext.tsx @@ -84,10 +84,10 @@ export const UserCtxProvider = ({children}:TUserContextProviderProps) => { { success: number; 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; - if(data.success && data.user) + if(data.success && data.data) { - setUser(data.user); + setUser(data.data); setWait(false); return {success:1}; }