Remove mastodon posts on delete and OTP
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user