Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Merge remote-tracking branch 'origin/main' into fix/duplicate-2fa-challenge-submissions

peaklabs-dev9eace1529aac
diff --cc resources/views/auth/two-factor-challenge.blade.php
index 33c9450181,b15afc24de..edcec90c05
--- a/resources/views/auth/two-factor-challenge.blade.php
+++ b/resources/views/auth/two-factor-challenge.blade.php
@@@ -2,32 -2,10 +2,20 @@@
<x-auth.shell title="Coolify" description="Verify your identity to finish signing in.">
<div class="flex flex-col gap-4" x-data="{
showRecovery: false,
+ submitting: false,
- digits: ['', '', '', '', '', ''],
- code: '',
+ handleSubmit(event) {
+ if (this.submitting) {
+ event.preventDefault();
+
+ return;
+ }
+
+ this.submitting = true;
+ },
- focusNext(event) {
- const nextInput = event.target.nextElementSibling;
- if (nextInput?.tagName === 'INPUT') nextInput.focus();
- },
- focusPrevious(event) {
- if (event.key !== 'Backspace' || event.target.value) return;
-
- const previousInput = event.target.previousElementSibling;
- if (previousInput?.tagName === 'INPUT') previousInput.focus();
- },
- updateCode() {
- this.code = this.digits.join('');
+ submitAuthenticatorCode(event) {
+ event.target.value = event.target.value.replace(/\D/g, '').slice(0, 6);
- if (this.code.length === 6) {
+ if (event.target.value.length === 6) {
this.$nextTick(() => this.$refs.challengeForm.requestSubmit());
}
},