Better AuthBA
Better Auth•11mo ago
Rufis

extending google social login scope not working

As stated above I am trying to extend the google scope
  socialProviders: {
    // https://www.better-auth.com/docs/authentication/google
    google: {
      clientId: process.env.GOOGLE_CLIENT_ID!,
      clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
      scope: [
        "https://www.googleapis.com/auth/user.birthday.read",
        "https://www.googleapis.com/auth/user.gender.read",
        "https://www.googleapis.com/auth/user.phonenumbers.read",
      ],
      mapProfileToUser: async (profile) => {
        console.log("🚀 ~ mapProfileToUser: ~ profile:", profile);

        return {
          firstName: profile.given_name,
          lastName: profile.family_name,
          name: `${profile.given_name} ${profile.family_name}`,
          image: profile.picture,
          email: profile.email,
          emailVerified: true,
        };
      },
    },

when logging the mapProfileToUser which comes back with the user information it doesn't display of the information that I made requried
Was this page helpful?