-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(auth): Remove auth provider entity (#6314)
**What** - remove auth provider entity **Why** - The auth provider entity was not really used anywhere **How** - Keeping loader behavior as is but removing the Co-authored-by: Sebastian Rindom <7554214+srindom@users.noreply.github.com>
- Loading branch information
Showing
37 changed files
with
178 additions
and
1,222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@medusajs/utils": patch | ||
--- | ||
|
||
feat(utils): return array or single entity based on input for modules created by internal module service factory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 13 additions & 6 deletions
19
integration-tests/plugins/helpers/create-authenticated-customer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,33 @@ | ||
import { IAuthModuleService, ICustomerModuleService } from "@medusajs/types" | ||
import { CreateCustomerDTO, MedusaContainer } from "@medusajs/types" | ||
|
||
import { ModuleRegistrationName } from "@medusajs/modules-sdk" | ||
import jwt from "jsonwebtoken" | ||
|
||
export const createAuthenticatedCustomer = async ( | ||
customerModuleService: ICustomerModuleService, | ||
authService: IAuthModuleService, | ||
jwtSecret: string | ||
appContainer: MedusaContainer, | ||
customerData: Partial<CreateCustomerDTO> = {} | ||
) => { | ||
const { jwt_secret } = appContainer.resolve("configModule").projectConfig | ||
const authService = appContainer.resolve(ModuleRegistrationName.AUTH) | ||
const customerModuleService = appContainer.resolve( | ||
ModuleRegistrationName.CUSTOMER | ||
) | ||
|
||
const customer = await customerModuleService.create({ | ||
first_name: "John", | ||
last_name: "Doe", | ||
email: "john@me.com", | ||
...customerData, | ||
}) | ||
|
||
const authUser = await authService.createAuthUser({ | ||
const authUser = await authService.create({ | ||
entity_id: "store_user", | ||
provider: "emailpass", | ||
scope: "store", | ||
app_metadata: { customer_id: customer.id }, | ||
}) | ||
|
||
const token = jwt.sign(authUser, jwtSecret) | ||
const token = jwt.sign(authUser, jwt_secret) | ||
|
||
return { customer, authUser, jwt: token } | ||
} |
41 changes: 0 additions & 41 deletions
41
packages/auth/integration-tests/__fixtures__/auth-provider/index.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.