mirror of
https://github.com/Dan6erbond/sk-auth.git
synced 2024-11-29 19:07:51 +01:00
fix: rename endpoint method to uppercase (#100)
* fix: rename endpoint method to uppercase * fix: prettier and lint
This commit is contained in:
parent
ca3cca1d6f
commit
fab4b8698d
@ -4,7 +4,6 @@ import { appAuth } from "$lib/appAuth";
|
|||||||
export const handle: Handle = async ({ event, resolve }) => {
|
export const handle: Handle = async ({ event, resolve }) => {
|
||||||
// TODO https://github.com/sveltejs/kit/issues/1046
|
// TODO https://github.com/sveltejs/kit/issues/1046
|
||||||
|
|
||||||
|
|
||||||
if (event.request.query.has("_method")) {
|
if (event.request.query.has("_method")) {
|
||||||
event.request.method = event.request.query.get("_method").toUpperCase();
|
event.request.method = event.request.query.get("_method").toUpperCase();
|
||||||
}
|
}
|
||||||
|
@ -245,12 +245,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class={clsx("text-lg", "mb-2")}>Session</p>
|
<p class={clsx("text-lg", "mb-2")}>Session</p>
|
||||||
<pre
|
<pre class={clsx("bg-gray-100", "whitespace-pre-wrap", "p-3")}>
|
||||||
class={clsx(
|
|
||||||
"bg-gray-100",
|
|
||||||
"whitespace-pre-wrap",
|
|
||||||
"p-3",
|
|
||||||
)}>
|
|
||||||
<code>{JSON.stringify($session, null, 2)}</code>
|
<code>{JSON.stringify($session, null, 2)}</code>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
@ -188,7 +188,7 @@ export class Auth {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
get: RequestHandler = async (event: RequestEvent): Promise<any> => {
|
GET: RequestHandler = async (event: RequestEvent): Promise<any> => {
|
||||||
const { url } = event;
|
const { url } = event;
|
||||||
|
|
||||||
if (url.pathname === this.getPath("csrf")) {
|
if (url.pathname === this.getPath("csrf")) {
|
||||||
@ -205,7 +205,7 @@ export class Auth {
|
|||||||
return await this.handleEndpoint(event);
|
return await this.handleEndpoint(event);
|
||||||
};
|
};
|
||||||
|
|
||||||
post: RequestHandler = async (event: RequestEvent) => {
|
POST: RequestHandler = async (event: RequestEvent) => {
|
||||||
return await this.handleEndpoint(event);
|
return await this.handleEndpoint(event);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user