Revamp auth module to support multiple providers linked to a single auth identity (#7521)
This commit is contained in:
@@ -130,13 +130,11 @@ export class GoogleAuthService extends AbstractAuthModuleProvider {
|
||||
try {
|
||||
authIdentity = await authIdentityService.retrieve({
|
||||
entity_id,
|
||||
provider: this.provider,
|
||||
})
|
||||
} catch (error) {
|
||||
if (error.type === MedusaError.Types.NOT_FOUND) {
|
||||
const createdAuthIdentity = await authIdentityService.create({
|
||||
entity_id,
|
||||
provider: this.provider,
|
||||
user_metadata: userMetadata,
|
||||
})
|
||||
authIdentity = createdAuthIdentity
|
||||
|
||||
Reference in New Issue
Block a user