MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / postAPI

Function postAPI

web/scripts/ragnar_modern.js:11681–11702  ·  view source on GitHub ↗
(endpoint, data)

Source from the content-addressed store, hash-verified

11679}
11680
11681async function handleRegenRecovery() {
11682 const password = prompt('Enter your current password to regenerate recovery codes:');
11683 if (!password) return;
11684
11685 const statusEl = document.getElementById('regen-status');
11686 const displayEl = document.getElementById('regen-codes-display');
11687
11688 try {
11689 const result = await postAPI('/api/auth/regenerate-recovery', { password });
11690 if (result.success) {
11691 displayEl.innerHTML = `
11692 <div class="p-3 rounded-lg bg-slate-800 border border-sky-700">
11693 <p class="text-sm text-gray-300 mb-2">New recovery codes (save these!):</p>
11694 <div class="grid grid-cols-2 gap-2">
11695 ${result.recovery_codes.map(code =>
11696 `<div class="font-mono text-sm bg-slate-900 rounded px-2 py-1 text-center text-sky-300 select-all">${code}</div>`
11697 ).join('')}
11698 </div>
11699 </div>
11700 `;
11701 displayEl.classList.remove('hidden');
11702
11703 statusEl.className = 'p-3 rounded-lg text-sm bg-green-900/30 border border-green-700 text-green-300';
11704 statusEl.textContent = 'Recovery codes regenerated. Save them securely!';
11705 statusEl.classList.remove('hidden');

Callers 15

onRusenseTabToggledFunction · 0.70
onTerminalToggledFunction · 0.70
_ndRunTextFunction · 0.70
runMtrFunction · 0.70
runSpeedtestFunction · 0.70
runDnsFunction · 0.70
runPmtuFunction · 0.70
runIperfFunction · 0.70
toggleIperfServerFunction · 0.70
installNetToolFunction · 0.70
runPtpFunction · 0.70
aiAnalyzePcapFunction · 0.70

Calls 2

errorMethod · 0.80
networkAwareFetchFunction · 0.70

Tested by

no test coverage detected