'fail', 'message' => '필수값 없음']); exit; } // Descope API - 비밀번호 변경 엔드포인트 사용 $url = "https://api.descope.com/v1/auth/password/update"; $data = [ "loginId" => $email, "newPassword" => $password, ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Authorization: Bearer " . $refreshJwt, "Content-Type: application/json" ]); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($code == 200) { echo json_encode(['status' => 'ok']); } else { $resData = json_decode($response, true); $msg = $resData['errorDescription'] ?? '비밀번호 변경 실패'; echo json_encode(['status' => 'fail', 'message' => $msg, 'raw' => $response]); } ?>