auth-helpers
auth-helpers copied to clipboard
api/auth/user catches non-POST requests
Bug report
Describe the bug
api/auth/user
catches non-POST requests thus blocking potential GET, PATCH or DELETE requests that the user may want to add.
To Reproduce
Create a api/auth/user.js
endpoint and add a GET request:
/** @type {import('@sveltejs/kit').RequestHandler} */
export async function GET() {
/**
* Redirect to `/`
*/
console.log("This gets called!");
return {
status: 302,
body: `<h1>Body doesn't get returned</h1>`
};
}
Expected behavior
Non-POST requests get ignored by the auth helper.