Remove mastodon posts on delete and OTP

This commit is contained in:
2026-08-26 14:16:29 +02:00
parent 80a3a3d541
commit f503dbaef2
24 changed files with 388 additions and 11 deletions
+3 -1
View File
@@ -8,6 +8,7 @@ const form = document.getElementById('settings-form');
const backendUrlInput = document.getElementById('backend-url');
const usernameInput = document.getElementById('username');
const passwordInput = document.getElementById('password');
const otpInput = document.getElementById('otp');
const session = document.getElementById('logged-in');
const sessionSummary = document.getElementById('session-summary');
const signOutButton = document.getElementById('sign-out');
@@ -74,7 +75,7 @@ async function saveSettingsAndLogin(event) {
const response = await fetch(`${backendUrl}/api/auth/login`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username, password })
body: JSON.stringify({ username, password, otp: otpInput.value.trim() || null })
});
if (!response.ok) {
@@ -93,6 +94,7 @@ async function saveSettingsAndLogin(event) {
showLoggedIn(data.user?.username || username, backendUrl);
passwordInput.value = '';
otpInput.value = '';
setStatus(t('loggedInSuccessfully'));
} catch (error) {
setStatus(t('unableToLogIn'), true);