diff --git a/bun.lockb b/bun.lockb index 30c521b..7cd8d59 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 724aa6a..8635f82 100644 --- a/package.json +++ b/package.json @@ -38,17 +38,13 @@ "uuid": "^11.0.2" }, "peerDependencies": { - "@remix-run/react": "^1.0.0 || ^2.0.0", - "@remix-run/server-runtime": "^1.0.0 || ^2.0.0" + "react-router": "^7.0.0" }, "devDependencies": { "@arethetypeswrong/cli": "^0.17.0", "@babel/preset-react": "^7.13.13", "@biomejs/biome": "^1.8.3", - "@remix-run/node": "^2.0.1", - "@remix-run/react": "^2.0.1", - "@remix-run/serve": "^2.0.1", - "@remix-run/server-runtime": "^2.0.1", + "react-router": "^7.0.1", "@total-typescript/tsconfig": "^1.0.4", "@types/bun": "^1.1.6", "@types/react": "^18.2.20", diff --git a/src/lib/authenticator.test.ts b/src/lib/authenticator.test.ts index 21d69a8..a05fad7 100644 --- a/src/lib/authenticator.test.ts +++ b/src/lib/authenticator.test.ts @@ -1,6 +1,10 @@ import { beforeEach, describe, expect, mock, test } from "bun:test"; -import { createCookieSessionStorage } from "@remix-run/node"; -import { SessionStorage, redirect } from "@remix-run/server-runtime"; +import { + SessionStorage, + createCookieSessionStorage, + redirect, +} from "react-router"; + import { AuthenticateOptions, Authenticator, diff --git a/src/lib/authenticator.ts b/src/lib/authenticator.ts index f510397..c63f485 100644 --- a/src/lib/authenticator.ts +++ b/src/lib/authenticator.ts @@ -3,7 +3,7 @@ import { type SessionStorage, isSession, redirect, -} from "@remix-run/server-runtime"; +} from "react-router"; import { type AuthenticateOptions, Strategy } from "./strategy.js"; export type AuthenticateCallback = (user: User) => Promise; diff --git a/src/lib/strategy.ts b/src/lib/strategy.ts index 062ac99..2d2033e 100644 --- a/src/lib/strategy.ts +++ b/src/lib/strategy.ts @@ -1,9 +1,9 @@ import { type AppLoadContext, type SessionStorage, - json, + data, redirect, -} from "@remix-run/server-runtime"; +} from "react-router"; import { AuthorizationError } from "./error.js"; /** @@ -123,7 +123,7 @@ export abstract class Strategy { // if a failureRedirect is not set, we throw a 401 Response or an error if (!options.failureRedirect) { if (options.throwOnError) throw new AuthorizationError(message, cause); - throw json<{ message: string }>({ message }, 401); + throw data<{ message: string }>({ message }, 401); } let session = await sessionStorage.getSession(