Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Auth] Implement POST handlers for login, signup, etc. on dbAuth #10448

Closed
dac09 opened this issue Apr 12, 2024 · 0 comments · Fixed by #10457
Closed

[Auth] Implement POST handlers for login, signup, etc. on dbAuth #10448

dac09 opened this issue Apr 12, 2024 · 0 comments · Fixed by #10457
Assignees

Comments

@dac09
Copy link
Collaborator

dac09 commented Apr 12, 2024

The dbAuth middleware will need to "handoff" requests to the DbAuthHandler whenever it intercepts a request for login, signup, etc.

The dbAuthHandler has to have the capability of parsing a Fetch API request, and responding so that the middleware can then use the output.

In essence the highlighted section of the middleware:

export const createDbAuthMiddleware = (/*...*/) => {
  return async (req: MiddlewareRequest) => {
    const res = MiddlewareResponse.next()

    if (req.method === 'POST') {
  // 👇 Middleware handoff to dbAuthHandler 👇
      const output = await dbAuthHandler(req)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
2 participants