add optional prefix to url
This commit is contained in:
@@ -45,11 +45,11 @@
|
||||
const fd = new FormData(form);
|
||||
const params = new URLSearchParams(Array.from(fd.entries()));
|
||||
try {
|
||||
const res = await fetch('/editor/profile/mfa/verify', { method: 'POST', headers: { 'X-CSRF-Token': getCSRF() }, body: params });
|
||||
const res = await fetch(window.prefix('/editor/profile/mfa/verify'), { method: 'POST', headers: { 'X-CSRF-Token': getCSRF() }, body: params });
|
||||
const data = await res.json().catch(() => ({}));
|
||||
if (res.ok && data.success) {
|
||||
showNotification('MFA enabled', 'success');
|
||||
window.location.href = '/editor/profile';
|
||||
window.location.href = window.prefix('/editor/profile');
|
||||
} else {
|
||||
throw new Error(data.error || res.statusText);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user