clerk/javascript

Cannot Use redirectToSignIn Method in @clerk/nextjs

AKRAM-2002 opened this issue · 2 comments

Preliminary Checks

Reproduction

https://github.com/AKRAM-2002/calisthenics-pro-lp

Publishable key

pk_test_ZGVjaWRpbmctc3F1a

Description

I've noticed that the redirectToSignIn method, which used to be available in import { redirectToSignIn } from "@clerk/nextjs/server";, is now deprecated.

I was using this method in my Next.js project to redirect users to the sign-in page when they are not authenticated. Could you please let me know if there's an alternative method or recommended approach to achieve this functionality with the current version of @clerk/nextjs?

Environment

Next.js Version: 14.2.5
@clerk/nextjs Version: 5.4.1
Node.js Version: v20.10.0

Hey, the method is now available via auth(): https://clerk.com/docs/references/nextjs/auth#redirect-to-sign-in

Thanks