🔒 Fixed admin forms defaulting to GET method (#20810)

ref
https://linear.app/tryghost/issue/ENG-1497/admin-signin-signup-and-setup-forms-default-to-get

- If method is not specified, the form will default to GET, which is
incorrect
- This commit sets the method to POST and action to javascript:void(0)
to prevent the form from submitting via GET if JavaScript is disabled or
not fully loaded yet
This commit is contained in:
Chris Raible 2024-08-21 15:49:52 -07:00 committed by GitHub
parent c0471f0c28
commit 6d46dc26c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@
<p>All over the world, people have started 3,000,000+ incredible sites with Ghost. Today, were starting yours.</p>
</header>
<form id="setup" class="gh-flow-form">
<form id="setup" method="post" action="javascript:void(0)" class="gh-flow-form">
<GhFormGroup @errors={{this.errors}} @hasValidated={{this.hasValidated}} @property="blogTitle">
<label for="blog-title">Site title</label>
<span class="gh-input-icon gh-icon-content">

View File

@ -12,7 +12,7 @@
</header>
</div>
{{else}}
<form id="login" class="gh-signin" novalidate="novalidate" {{on "submit" (perform this.validateAndAuthenticateTask)}}>
<form id="login" method="post" action="javascript:void(0)" class="gh-signin" novalidate="novalidate" {{on "submit" (perform this.validateAndAuthenticateTask)}}>
<header>
<div class="gh-site-icon" style={{site-icon-style}}></div>
<h1>{{this.config.blogTitle}}</h1>

View File

@ -7,7 +7,7 @@
<h1>Create your account.</h1>
</header>
<form id="signup" class="gh-signup" novalidate="novalidate" {{on "submit" this.submit}}>
<form id="signup" method="post" action="javascript:void(0)" class="gh-signup" novalidate="novalidate" {{on "submit" this.submit}}>
<GhFormGroup @errors={{this.signupDetails.errors}} @hasValidated={{this.signupDetails.hasValidated}} @property="name">
<label for="name">Full name</label>
<span class="gh-input-icon gh-icon-user">