Revamp the authentication setup (#7419)
* feat: Add email pass authentication provider package * feat: Revamp auth module and remove concept of scope * feat: Revamp the auth module to be more standardized in how providers are loaded * feat: Switch from scope to actor type for authentication * feat: Add support for per-actor auth methods * feat: Add emailpass auth provider by default * fix: Add back app_metadata in auth module
This commit is contained in:
@@ -43,14 +43,13 @@ medusaIntegrationTestRunner({
|
||||
await authService.create({
|
||||
provider: "emailpass",
|
||||
entity_id: email,
|
||||
scope: "admin",
|
||||
provider_metadata: {
|
||||
password: passwordHash,
|
||||
},
|
||||
})
|
||||
|
||||
const response = await api
|
||||
.post(`/auth/admin/emailpass`, {
|
||||
.post(`/auth/user/emailpass`, {
|
||||
email: email,
|
||||
password: password,
|
||||
})
|
||||
@@ -75,14 +74,13 @@ medusaIntegrationTestRunner({
|
||||
await authService.create({
|
||||
provider: "emailpass",
|
||||
entity_id: email,
|
||||
scope: "admin",
|
||||
provider_metadata: {
|
||||
password: passwordHash,
|
||||
},
|
||||
})
|
||||
|
||||
const error = await api
|
||||
.post(`/auth/admin/emailpass`, {
|
||||
.post(`/auth/user/emailpass`, {
|
||||
email: email,
|
||||
password: "incorrect-password",
|
||||
})
|
||||
@@ -101,7 +99,7 @@ medusaIntegrationTestRunner({
|
||||
).toString("base64")
|
||||
|
||||
const error = await api
|
||||
.post(`/auth/admin/emailpass`, {
|
||||
.post(`/auth/user/emailpass`, {
|
||||
email: "should-not-exist",
|
||||
password: "should-not-exist",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user