fix: Use sub instead of email for google entity ID (#9949)
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/auth-google": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: Use sub instead of email for google entity ID
|
||||||
@@ -155,7 +155,7 @@ describe("Google auth provider", () => {
|
|||||||
return {
|
return {
|
||||||
provider_identities: [
|
provider_identities: [
|
||||||
{
|
{
|
||||||
entity_id: "test@admin.com",
|
entity_id: "113664482950786663866",
|
||||||
provider: "google",
|
provider: "google",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -180,7 +180,7 @@ describe("Google auth provider", () => {
|
|||||||
authIdentity: {
|
authIdentity: {
|
||||||
provider_identities: [
|
provider_identities: [
|
||||||
{
|
{
|
||||||
entity_id: "test@admin.com",
|
entity_id: "113664482950786663866",
|
||||||
provider: "google",
|
provider: "google",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -194,7 +194,7 @@ describe("Google auth provider", () => {
|
|||||||
return {
|
return {
|
||||||
provider_identities: [
|
provider_identities: [
|
||||||
{
|
{
|
||||||
entity_id: "test@admin.com",
|
entity_id: "113664482950786663866",
|
||||||
provider: "google",
|
provider: "google",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -222,7 +222,7 @@ describe("Google auth provider", () => {
|
|||||||
authIdentity: {
|
authIdentity: {
|
||||||
provider_identities: [
|
provider_identities: [
|
||||||
{
|
{
|
||||||
entity_id: "test@admin.com",
|
entity_id: "113664482950786663866",
|
||||||
provider: "google",
|
provider: "google",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -142,8 +142,7 @@ export class GoogleAuthService extends AbstractAuthModuleProvider {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: We should probably use something else than email here, like the `sub` field (which is more constant than the email)
|
const entity_id = payload.sub
|
||||||
const entity_id = payload.email
|
|
||||||
const userMetadata = {
|
const userMetadata = {
|
||||||
name: payload.name,
|
name: payload.name,
|
||||||
picture: payload.picture,
|
picture: payload.picture,
|
||||||
|
|||||||
Reference in New Issue
Block a user