Cannot Use redirectToSignIn Method in @clerk/nextjs
AKRAM-2002 opened this issue · 2 comments
Preliminary Checks
-
I have reviewed the documentation: https://clerk.com/docs
-
I have searched for existing issues: https://github.com/clerk/javascript/issues
-
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
-
This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
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