Relative Content

Tag Archive for next.jsclerk

How to make Clerk’s show account selections

I’m now adding Clerk’s <SignIn> component into my NextJS app. The Google social login works fine, but it just signs me in with my Chrome account without showing account selections. I’m wondering if there’s any config available to turn the prompt on like this

How to make Clerk’s show account selections

I’m now adding Clerk’s <SignIn> component into my NextJS app. The Google social login works fine, but it just signs me in with my Chrome account without showing account selections. I’m wondering if there’s any config available to turn the prompt on like this

Error: `headers` was called outside a request scope | Next.js

I’m using Clerk version 5.1.4 and Next.js 14.2.3, and got the following error when calling the auth() function in a server component:
Clerk: auth() and currentUser() are only supported in App Router (/app directory). If you're using /pages, try getAuth() instead. Original error: Error: headers was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context
I’ve made sure I’m using App Router (/app directory), but the error still occurs. What else should I check or configure to fix this issue? Is there a way to ensure that auth() is called properly in the Next.js server environment?

NextJS- I can’t get sessionID through Middleware with the new Clerk

import { clerkMiddleware } from “@clerk/nextjs/server”; import { createRouteMatcher } from “@clerk/nextjs/server”; import { NextResponse } from “next/server”; const isPrivateRoute = createRouteMatcher([ ‘/dashboard(.*)’, ]); const isPublicRoute = createRouteMatcher([ ‘/(.*)’, ‘/auth/sign-in(.*)’, ‘/auth/sign-up(.*)’ ]) export default clerkMiddleware((auth, req) => { if(isPrivateRoute(req)){ if(!auth().sessionId && !auth().userId){ auth().protect(); } return NextResponse.next(); } return NextResponse.next(); },{ debug:true}); export const config = […]

NextJs signUp.create() gives ” not assignable …” failure

This is my first time working with a NextJs project, and I am following the instruction on the book to try to create a register page where user may create a new account by submitting these value: “first_name”, “last_name”, “email” and “password” value.