Add remember me checkbox, center and narrow sign-in form
- Add "Remember me for 30 days" checkbox (30-day vs 24-hour session expiry) - Center heading and constrain form width to max-w-md - Preserve remember_me preference through TOTP and WebAuthn auth flows Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -180,7 +180,8 @@ export default class extends Controller {
|
||||
"X-CSRF-Token": this.getCSRFToken()
|
||||
},
|
||||
body: JSON.stringify({
|
||||
email: this.getUserEmail()
|
||||
email: this.getUserEmail(),
|
||||
remember_me: this.getRememberMe()
|
||||
})
|
||||
});
|
||||
|
||||
@@ -295,6 +296,11 @@ export default class extends Controller {
|
||||
return emailInput ? emailInput.value.trim() : "";
|
||||
}
|
||||
|
||||
getRememberMe() {
|
||||
const checkbox = document.querySelector('input[name="remember_me"][type="checkbox"]');
|
||||
return checkbox ? checkbox.checked : false;
|
||||
}
|
||||
|
||||
isValidEmail(email) {
|
||||
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user