Please take a look at the video. It seems like authjs is not redirecting to the authorization url automatically.
"next": "^15.0.1"
"next-auth": "5.0.0-beta.25"
signIn server action
import { signIn as naSignIn, signOut as naSignOut } from "~/server/auth";
import { redirect } from 'next/navigation'
export async function signIn(
provider: string,
credentials?: z.infer<typeof userLoginForm>,
) {
try {
if (provider == "credentials") {
await naSignIn(provider, { ...credentials});
} else await naSignIn(provider);
} catch (error) {
if (isRedirectError(error)) {
return error.message;
} else if (error instanceof CredentialsSignin) {
return error.cause;
} else if (error instanceof ZodError) {
return error.message;
} else if (error instanceof Error) {
console.log(error);
return error.message;
} else if (typeof error === "string") {
return error;
} else {
return "something went wrong";
}
}
if (provider == "credentials") redirect("/", RedirectType.replace)
}