socialProviders: {
google: {
clientId: "YOUR_GOOGLE_CLIENT_ID",
clientSecret: "YOUR_GOOGLE_CLIENT_SECRET",
mapProfileToUser: (profile) => {
return {
// Override default image with your custom one
image: "https://your-domain.com/default-avatar.png",
// Customize the name format
name: `${profile.given_name} ${profile.family_name}`,
// Add any additional fields you want to set
username: profile.email.split('@')[0],
// You can still access the original profile data
// profile.picture, profile.name, etc.
};
}
}
}
socialProviders: {
google: {
clientId: "YOUR_GOOGLE_CLIENT_ID",
clientSecret: "YOUR_GOOGLE_CLIENT_SECRET",
mapProfileToUser: (profile) => {
return {
// Override default image with your custom one
image: "https://your-domain.com/default-avatar.png",
// Customize the name format
name: `${profile.given_name} ${profile.family_name}`,
// Add any additional fields you want to set
username: profile.email.split('@')[0],
// You can still access the original profile data
// profile.picture, profile.name, etc.
};
}
}
}