export const auth = defineAuth({
loginWith: {
email: true,
externalProviders: {
callbackUrls: [
"http://localhost:3000/authenticate",
"https://www.redon.ai/authenticate",
"https://main.d376h48d6ioxyy.amplifyapp.com/authenticate",
],
logoutUrls: [
"http://localhost:3000",
"https://www.redon.ai/",
"https://main.d376h48d6ioxyy.amplifyapp.com/",
],
google: {
scopes: ["email"],
clientId: secret("GOOGLE_CLIENT_ID"),
clientSecret: secret("GOOGLE_CLIENT_SECRET"),
attributeMapping: {
email: "email",
preferredUsername: "email",
},
},
},
},
userAttributes: {
email: {
required: true,
mutable: false,
},
},
});
This is my defineAuth. I have mapped attributes and external provider google.
But when I login through email password and then through google. it creates 2 different users.