diff --git a/src/js/account/render.js b/src/js/account/render.js index c2b0730..38f2d92 100644 --- a/src/js/account/render.js +++ b/src/js/account/render.js @@ -18,7 +18,7 @@ export function renderLoginForm() {
- Log In
+
Forgot Password?
@@ -42,7 +42,7 @@ export function renderLoginForm() {
- Create Account +
diff --git a/src/js/account/setupListeners.js b/src/js/account/setupListeners.js index f17816b..60670d4 100644 --- a/src/js/account/setupListeners.js +++ b/src/js/account/setupListeners.js @@ -10,6 +10,30 @@ export function setupLoginModal(modal) { }); }); + [ + document.getElementById('loginEmail'), + document.getElementById('loginPassword'), + ].forEach(field => { + field.addEventListener('keydown', event => { + if (['Enter', 'Return'].includes(event.key)) { + logIn(); + } + }); + }); + + [ + document.getElementById('createNewEmail'), + document.getElementById('createNewPassword'), + document.getElementById('createNewConfirm'), + document.getElementById('createNewPublicName'), + ].forEach(field => { + field.addEventListener('keydown', event => { + if (['Enter', 'Return'].includes(event.key)) { + createAccount(); + } + }); + }); + document.getElementById('loginSubmit').addEventListener('click', logIn); document.getElementById('createAccountSubmit').addEventListener('click', createAccount); }