Skip to content

Commit

Permalink
apply prevent-default for more occurrences of {{on 'submit'}}
Browse files Browse the repository at this point in the history
  • Loading branch information
DrumsnChocolate committed Nov 5, 2024
1 parent 4d29d7b commit cf0a533
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions app/controllers/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ export default class LoginController extends Controller {
@tracked twoFactorRequired;

@action
async authenticate(e) {
e.preventDefault();

async authenticate() {
const headers = {};
if (this.twoFactorRequired) {
headers['X-Amber-OTP'] = this.verificationCode;
Expand Down
2 changes: 1 addition & 1 deletion app/templates/debit/collections/collection/edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h5>{{if @model.isNew 'Incasso aanmaken' 'Incasso wijzigen'}}</h5>
</div>
<div class='card-body'>
<form {{on 'submit' this.submit}}>
<form {{on 'submit' (prevent-default this.submit)}}>
<ModelForm::TextInput
@model={{model}}
@property='name'
Expand Down
2 changes: 1 addition & 1 deletion app/templates/login.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}}
</h5>
</div>
<form {{on 'submit' this.authenticate}} method='post'>
<form {{on 'submit' (prevent-default this.authenticate)}} method='post'>
<div class='card-body p-4'>
{{#if errorMessage}}
<div class='alert alert-danger' role='alert' data-test-error>
Expand Down

0 comments on commit cf0a533

Please sign in to comment.