Initial config with email service test
Build LinkLog Development Image / development-image (push) Successful in 11s
Build LinkLog Development Image / development-image (push) Successful in 11s
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// Copyright © 2026 Olaf Kolkman
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const resetForm = document.querySelector('#reset-password-form');
|
||||
const resetStatus = document.querySelector('#reset-password-status');
|
||||
const resetToken = new URLSearchParams(window.location.search).get('token');
|
||||
|
||||
resetForm.addEventListener('submit', async (event) => {
|
||||
event.preventDefault();
|
||||
const response = await fetch('/api/auth/reset-password', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({token: resetToken, password: new FormData(resetForm).get('password')}),
|
||||
});
|
||||
const result = await response.json();
|
||||
resetStatus.textContent = response.ok ? `${result.message} Redirecting...` : (result.detail || 'Reset failed.');
|
||||
resetStatus.style.color = response.ok ? '#166534' : '#b91c1c';
|
||||
if (response.ok) window.setTimeout(() => window.location.assign('/login'), 1000);
|
||||
});
|
||||
Reference in New Issue
Block a user