Remove migration logic again
This commit is contained in:
parent
1a068e3217
commit
87da2a3861
6 changed files with 23 additions and 277 deletions
|
|
@ -231,15 +231,26 @@
|
|||
const registrationPasswordField = document.getElementById('registrationPasswordField');
|
||||
const registrationPasswordInput = document.getElementById('registrationPassword');
|
||||
|
||||
// Check if registration password is required by checking URL parameters
|
||||
// If ?invite=true or REGISTRATION_PASSWORD is set, show the field
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const showRegistrationPassword = urlParams.has('invite') || urlParams.has('code');
|
||||
// Fetch registration status from API
|
||||
try {
|
||||
const response = await fetch('/api/auth/registration-status');
|
||||
const data = await response.json();
|
||||
|
||||
// Always show the field and let backend validate
|
||||
// This simplifies the logic - if not required, backend will ignore it
|
||||
registrationPasswordField.style.display = 'block';
|
||||
registrationPasswordInput.required = true;
|
||||
if (data.passwordRequired) {
|
||||
// Show registration password field if required
|
||||
registrationPasswordField.style.display = 'block';
|
||||
registrationPasswordInput.required = true;
|
||||
} else {
|
||||
// Hide registration password field if not required
|
||||
registrationPasswordField.style.display = 'none';
|
||||
registrationPasswordInput.required = false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch registration status:', error);
|
||||
// On error, assume password is not required
|
||||
registrationPasswordField.style.display = 'none';
|
||||
registrationPasswordInput.required = false;
|
||||
}
|
||||
|
||||
// Password confirmation validation
|
||||
confirmPassword.addEventListener('input', function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue