Skip to content

Commit

Permalink
feat: change Nextjs siweApi to be a function that reurns a NextApiHan…
Browse files Browse the repository at this point in the history
…dler

this will allow for us to pass in options in the future without changing the API

BREAKING CHANGE: siweApi is no longer a NextApiHandler but instead a function
that returns a NextApiHandler
  • Loading branch information
aj-may committed Jan 13, 2023
1 parent 3f9d12c commit 8140a94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/next/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { getSession, methodNotAllowed, notFound, signIn, signOut } from "../api.js";

export const siweApi = async (req: NextApiRequest, res: NextApiResponse) => {
export const siweApi = () => async (req: NextApiRequest, res: NextApiResponse) => {
let { route } = req.query;
if (route instanceof Array) route = route[0];
const { method } = req;
Expand Down

0 comments on commit 8140a94

Please sign in to comment.