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

useAuthenticatedBlitzContext doesn not populate next url param on redirect (app router) #4330

Open
florian-klemt opened this issue May 8, 2024 · 0 comments
Labels
kind/bug Something isn't working status/triage

Comments

@florian-klemt
Copy link

florian-klemt commented May 8, 2024

What is the problem?

When using useAuthenticatedBlitzContext in the app router, the next url parameter is not set after redirection.

What are detailed steps to reproduce this?

Create /app/my-page.tsx

import { Metadata } from "next";
import { useAuthenticatedBlitzContext } from "src/blitz-server";

export const metadata: Metadata = {
  title: "My Page"
};

export default async function MyPage() {
  await useAuthenticatedBlitzContext({
    redirectTo: "/auth/login"
  });

  return (
    <div>
      My Page
    </div>
  );
}

and open http://localhost:3000/my-page (while NOT being authenticated).

You will see that you do get redirected to /auth/login but the next url parameter is missing

@florian-klemt florian-klemt added kind/bug Something isn't working status/triage labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/triage
Projects
None yet
Development

No branches or pull requests

1 participant