🐛 Removed method="post" on sign in/up forms in Admin (#20598)

ref https://linear.app/tryghost/issue/ONC-160
- POST is incorrect as the form itself doesn't post to any path; all we
want are the authentication flows to kick off on submit

We've had reports of users experiencing a 404 error on attempting to
sign in to Ghost Admin (at /ghost/), where the login form seems to
submit a POST request to the /ghost/ path (we don't have a route for
that method, hence the 404; only GET). While I haven't been able to
reproduce the issue, there's very few places in Ghost that actually
issue a POST request.

Removing this method here has no impact to Ghost auth and may prevent
some unexpected default behavior from the browser.
This commit is contained in:
Steve Larson 2024-07-11 17:03:50 -05:00 committed by GitHub
parent cd15cb8c30
commit 3cfdcfb15f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@
</header>
</div>
{{else}}
<form id="login" method="post" class="gh-signin" novalidate="novalidate" {{on "submit" (perform this.validateAndAuthenticateTask)}}>
<form id="login" 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" method="post" novalidate="novalidate" {{on "submit" this.submit}}>
<form id="signup" 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">