Post sign up hook for google provider

Hi, I've implemented a post sign up hook for an email provider where I send an internal event to my team when a user signs up. Now I would like to do the same for the google provider. Can you advice how I can identify when the user signs up (creates a new account) as opposed to logs in?

Here's my existing after hook
  hooks: {
    after: createAuthMiddleware(async (ctx) => {
      const isFromEmail = ctx.path.startsWith('/verify-email');

      if (isFromEmail) {
        const newSession = ctx.context.newSession;
        if (newSession) {
          const user = newSession.user;
          try {
            await sendProductEventMessage(`[NEW USER SIGNED UP] ${user.name} (${user.email})`);
          } catch (error) {
            console.error('Error sending product event message', error);
          }
        }
      }
    }),
  },
Was this page helpful?