Esempio n. 1
0
    $user['fname'] = decode5t($user['fname']);
    $user['lname'] = decode5t($user['lname']);
    $auth = new AUTH();
    $auth->set($_SERVER['HTTP_ORIGIN'], $user['email']);
    $response['Ident'] = $user;
    $response['Auth'] = $auth->token;
    $tok = new AUTHTOKEN();
    $tok->get();
    $jwt = JWT::encode($response, $tok->response);
    echo json_encode($jwt);
});
// Refresh
$app->post('/refresh', function () use($app) {
    $request = (array) json_decode($app->request->getBody());
    $action = new Identity();
    $action->refresh($request);
    $query = new Request();
    $user = $query->query($action->sql);
    $user = $user[0];
    $response = $user;
    // if ($_SESSION['oy'] === $request['authorize']) {
    // } else {
    //   $response = array($_SESSION['oy'], $request['authorize']);
    // }
    echo json_encode($response);
});
$app->post('/checkemail', function () use($app) {
    $request = (array) json_decode($app->request->getBody());
    $response = $request;
    echo json_encode($response);
});