auth-helpers icon indicating copy to clipboard operation
auth-helpers copied to clipboard

api/auth/user catches non-POST requests

Open Blade67 opened this issue 2 years ago • 0 comments

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.

Blade67 avatar Aug 08 '22 13:08 Blade67