-
-
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): Rename authentication to auth (#6229)
**What** - rename `authenticationModule` -> `authModule`
- Loading branch information
Showing
70 changed files
with
244 additions
and
146 deletions.
There are no files selected for viewing
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
packages/authentication/CHANGELOG.md → packages/auth/CHANGELOG.md
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,4 +1,4 @@ | ||
# @medusajs/authentication | ||
# @medusajs/auth | ||
|
||
## 0.0.2 | ||
|
||
|
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,3 @@ | ||
# Auth Module | ||
|
||
The Auth Module is Medusa’s authentication engine engine. It provides functions to authenticate users through identity providers and store metadata about users that can be used for authorization purposes. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { AuthenticationInput, IAuthModuleService } from "@medusajs/types" | ||
import { MedusaModule, Modules } from "@medusajs/modules-sdk" | ||
|
||
import { IAuthenticationModuleService } from "@medusajs/types" | ||
import { MikroOrmWrapper } from "../../../utils" | ||
import Scrypt from "scrypt-kdf" | ||
import { SqlEntityManager } from "@mikro-orm/postgresql" | ||
|
@@ -15,8 +15,8 @@ const seedDefaultData = async (testManager) => { | |
await createAuthUsers(testManager) | ||
} | ||
|
||
describe("AuthenticationModuleService - AuthProvider", () => { | ||
let service: IAuthenticationModuleService | ||
describe("AuthModuleService - AuthProvider", () => { | ||
let service: IAuthModuleService | ||
let testManager: SqlEntityManager | ||
let shutdownFunc: () => Promise<void> | ||
|
||
|
@@ -25,7 +25,7 @@ describe("AuthenticationModuleService - AuthProvider", () => { | |
|
||
const { medusaApp, shutdown } = await initModules(initModulesConfig) | ||
|
||
service = medusaApp.modules[Modules.AUTHENTICATION] | ||
service = medusaApp.modules[Modules.AUTH] | ||
|
||
shutdownFunc = shutdown | ||
}) | ||
|
@@ -60,15 +60,15 @@ describe("AuthenticationModuleService - AuthProvider", () => { | |
await createAuthUsers(testManager, [ | ||
// Add authenticated user | ||
{ | ||
provider: "usernamePassword", | ||
provider: "emailpass", | ||
entity_id: email, | ||
provider_metadata: { | ||
password: passwordHash, | ||
}, | ||
}, | ||
]) | ||
|
||
const res = await service.authenticate("usernamePassword", { | ||
const res = await service.authenticate("emailpass", { | ||
body: { | ||
email: "[email protected]", | ||
password: password, | ||
|
@@ -90,7 +90,7 @@ describe("AuthenticationModuleService - AuthProvider", () => { | |
|
||
await seedDefaultData(testManager) | ||
|
||
const res = await service.authenticate("usernamePassword", { | ||
const res = await service.authenticate("emailpass", { | ||
body: { email: "[email protected]" }, | ||
scope: "store", | ||
}) | ||
|
@@ -104,7 +104,7 @@ describe("AuthenticationModuleService - AuthProvider", () => { | |
it("fails when no email is given", async () => { | ||
await seedDefaultData(testManager) | ||
|
||
const res = await service.authenticate("usernamePassword", { | ||
const res = await service.authenticate("emailpass", { | ||
body: { password: "supersecret" }, | ||
scope: "store", | ||
}) | ||
|
@@ -126,15 +126,15 @@ describe("AuthenticationModuleService - AuthProvider", () => { | |
await createAuthUsers(testManager, [ | ||
// Add authenticated user | ||
{ | ||
provider: "usernamePassword", | ||
provider: "emailpass", | ||
entity_id: email, | ||
provider_metadata: { | ||
password_hash: passwordHash, | ||
}, | ||
}, | ||
]) | ||
|
||
const res = await service.authenticate("usernamePassword", { | ||
const res = await service.authenticate("emailpass", { | ||
body: { | ||
email: "[email protected]", | ||
password: "password", | ||
|
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,6 @@ | ||
if (typeof process.env.DB_TEMP_NAME === "undefined") { | ||
const tempName = parseInt(process.env.JEST_WORKER_ID || "1") | ||
process.env.DB_TEMP_NAME = `medusa-auth-integration-${tempName}` | ||
} | ||
|
||
process.env.MEDUSA_AUTH_DB_SCHEMA = "public" |
File renamed without changes.
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
6 changes: 3 additions & 3 deletions
6
...ation/integration-tests/utils/database.ts → .../auth/integration-tests/utils/database.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
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
Oops, something went wrong.