MCPcopy Create free account
hub / github.com/error311/FileRise / loadTOTPQRCode

Function loadTOTPQRCode

public/js/authModals.js:259–277  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

257}
258
259function loadTOTPQRCode() {
260 fetch("/api/profile/totp_setup.php", {
261 method: "GET",
262 credentials: "include",
263 headers: { "X-CSRF-Token": window.csrfToken }
264 })
265 .then(res => {
266 if (!res.ok) throw new Error("Failed to fetch QR code: " + res.status);
267 return res.blob();
268 })
269 .then(blob => {
270 const url = URL.createObjectURL(blob);
271 document.getElementById("totpQRCodeImage").src = url;
272 })
273 .catch(err => {
274 console.error(err);
275 showToast(t("error_loading_qr_code"));
276 });
277}
278
279export function closeTOTPModal(disable = true) {
280 const totpModal = document.getElementById("totpModal");

Callers 1

openTOTPModalFunction · 0.85

Calls 2

tFunction · 0.85
showToastFunction · 0.70

Tested by

no test coverage detected