Web Dev CodyW
Convex Community2y ago
14 replies
Web Dev Cody

I'm getting null for getUserIdentity

Any clue why I keep getting null for getUserIdentity. Do I maybe just have something misconfigured?
I'm using the next.js stuff

"use client";

import { ConvexAuthNextjsProvider } from "@convex-dev/auth/nextjs";
import { ReactNode } from "react";
import { ConvexReactClient } from "convex/react";

const convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!);

export default function ConvexClientProvider({
  children,
}: {
  children: ReactNode;
}) {
  return (
    <ConvexAuthNextjsProvider client={convex}>
      {children}
    </ConvexAuthNextjsProvider>
  );
}


then I call an action
  const generateVideoAction = useAction(api.videos.generateVideoAction);


I'm logged in

export const generateVideoAction = action({
  args: {
    script: v.string(),
  },
  async handler(ctx, input) {
    console.log(await ctx.auth.getUserIdentity());

this prints null
Was this page helpful?