feat(auth): Revamp authentication setup (#7387)
* chore: Clean up authentication middlewares * chore: Rename AuthUser to AuthIdentity * feat: Define link between user, customer, and auth identity * feat: Use links for auth, update auth context content * fix: Adjust user create command with new auth setup * fix: Make auth login more dynamic, review fixes * fix: Change test assertions for created by
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { AuthUser } from "@models"
|
||||
import { AuthIdentity } from "@models"
|
||||
import { MapToConfig } from "@medusajs/utils"
|
||||
import { ModuleJoinerConfig } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/modules-sdk"
|
||||
|
||||
export const LinkableKeys = {
|
||||
auth_user_id: AuthUser.name,
|
||||
auth_identity_id: AuthIdentity.name,
|
||||
}
|
||||
|
||||
const entityLinkableKeysMap: MapToConfig = {}
|
||||
@@ -23,9 +23,9 @@ export const joinerConfig: ModuleJoinerConfig = {
|
||||
primaryKeys: ["id"],
|
||||
linkableKeys: LinkableKeys,
|
||||
alias: {
|
||||
name: ["auth_user", "auth_users"],
|
||||
name: ["auth_identity", "auth_identities"],
|
||||
args: {
|
||||
entity: AuthUser.name,
|
||||
entity: AuthIdentity.name,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user