Skip to content

Commit

Permalink
fix: include root path in redirect parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
polyrainbow committed Feb 14, 2025
1 parent 34b0f1a commit e36b600
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/NoteAccessProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from "../lib/LocalDataStorage";
import { getAppPath } from "../lib/utils";
import { PathTemplate } from "../types/PathTemplate";
import { ROOT_PATH } from "../config";
import useRunOnce from "../hooks/useRunOnce";

const NoteAccessProvider = ({
Expand All @@ -26,9 +25,14 @@ const NoteAccessProvider = ({
})
.catch(() => {
const urlParams = new URLSearchParams();
/*
Note: redirect param includes ROOT_PATH, e.g. "/neno/".
When redirecting to it, consumers should not include ROOT_PATH
but use the path as is.
*/
urlParams.set(
"redirect",
window.location.pathname.substring(ROOT_PATH.length - 1),
window.location.pathname,
);
// @ts-ignore
navigation.navigate(
Expand Down

0 comments on commit e36b600

Please sign in to comment.