Skip to content

with-passport-and-next-connect redefines response end function as async #51628

Open
@ntaranov

Description

@ntaranov

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

---

Which example does this report relate to?

with-passport-and-next-connect

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

Here in with-passport-and-next-connect end function is defined as async. This cannot be correct as it's called without await by the framework creating a race condition.

This is a result of

  • Trying to override sync end
  • Using async @hapi\iron apis

Expected Behavior

This can be fixed either by saving the session somewhere else or by using a sync cryptography API.

To Reproduce

Run the example, see API resolved without sending a response for /api/auth/session, this may result in stalled requests. in the console.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    examplesIssue was opened via the examples template.good first issueEasy to fix issues, good for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions