Revamp auth module to support multiple providers linked to a single auth identity (#7521)

This commit is contained in:
Stevche Radevski authored and GitHub committed 2024-06-05 07:47:16 +00:00
1 parent 20cd6a7b51
commit fafc92b875
23 files changed
+640 -216

No files matched your search

@@ -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