fix: rename endpoint method to uppercase (#100)

* fix: rename endpoint method to uppercase

* fix: prettier and lint
This commit is contained in:
Leo Voon 2022-07-26 22:32:48 +08:00 committed by GitHub
parent ca3cca1d6f
commit fab4b8698d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 9 deletions

View File

@ -4,7 +4,6 @@ import { appAuth } from "$lib/appAuth";
export const handle: Handle = async ({ event, resolve }) => {
// TODO https://github.com/sveltejs/kit/issues/1046
if (event.request.query.has("_method")) {
event.request.method = event.request.query.get("_method").toUpperCase();
}

View File

@ -245,12 +245,7 @@
</div>
<p class={clsx("text-lg", "mb-2")}>Session</p>
<pre
class={clsx(
"bg-gray-100",
"whitespace-pre-wrap",
"p-3",
)}>
<pre class={clsx("bg-gray-100", "whitespace-pre-wrap", "p-3")}>
<code>{JSON.stringify($session, null, 2)}</code>
</pre>
</div>

View File

@ -188,7 +188,7 @@ export class Auth {
};
}
get: RequestHandler = async (event: RequestEvent): Promise<any> => {
GET: RequestHandler = async (event: RequestEvent): Promise<any> => {
const { url } = event;
if (url.pathname === this.getPath("csrf")) {
@ -205,7 +205,7 @@ export class Auth {
return await this.handleEndpoint(event);
};
post: RequestHandler = async (event: RequestEvent) => {
POST: RequestHandler = async (event: RequestEvent) => {
return await this.handleEndpoint(event);
};