fix: use current url as a fallback

This commit is contained in:
Bereket Engida
2024-11-02 20:13:52 +03:00
parent 6f41552c6e
commit 64531ef5ae
3 changed files with 4 additions and 8 deletions

View File

@@ -10,7 +10,10 @@ import { logger } from "../utils";
import { checkURLValidity } from "../utils/url";
export async function generateState(c: GenericEndpointContext) {
const callbackURL = c.body?.callbackURL;
const callbackURL =
c.body?.callbackURL || c.query?.currentURL
? new URL(c.query?.currentURL).origin
: "";
if (!callbackURL) {
throw new APIError("BAD_REQUEST", {
message: "callbackURL is required",

View File

@@ -34,9 +34,6 @@
"expo-web-browser": "~13.0.3",
"vitest": "^1.6.0"
},
"dependencies": {
"nanostores": "^0.11.2"
},
"peerDependencies": {
"better-auth": "workspace:*"
}

4
pnpm-lock.yaml generated
View File

@@ -1768,10 +1768,6 @@ importers:
version: 1.6.0(@edge-runtime/vm@3.2.0)(@types/node@22.8.4)(happy-dom@15.7.4)(jsdom@25.0.1)(lightningcss@1.27.0)(terser@5.33.0)
packages/expo:
dependencies:
nanostores:
specifier: ^0.11.2
version: 0.11.3
devDependencies:
better-auth:
specifier: workspace:*