How to insert timestamp in lastLogin for social login like google

 const signInWithGoogle = async () => {
    try {
      await authClient.signIn.social({
        provider: "google",
        callbackURL: "http://localhost:3000/dashboard",
      });

      await authClient.updateUser({
        lastLogin: new Date().toISOString(),
      });
    } catch (error) {
      console.error("Error during sign in or database update:", error);
    }
  };
Was this page helpful?