feat: Update authentication middleware (#6447)
* authentication middleware update * disable customer authentication * call correct feature flag method * fix authentication middleware for store/customers * fix integration tests and add middleware for admin customers * update seeders * customer groups fix * add authentication middleware for all admin endpoints * Feat(medusa, user): require authentication for invite accept (#6448) * initial invite token validation for authentication invocation * remove invite auth * remove unused import * cleanup tests * refactor to auth instead of auth_user * pr feedback * update authenticatedRequest type * update store authenticated endpoints * update routes with type * fix build * fix build * fix build * use auth middleware for api-keys
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import { initDb, useDb } from "../../../environment-helpers/use-db"
|
||||
|
||||
import { IUserModuleService } from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||
import { getContainer } from "../../../environment-helpers/use-container"
|
||||
import { AxiosInstance } from "axios"
|
||||
import { createAdminUser } from "../../helpers/create-admin-user"
|
||||
import path from "path"
|
||||
import { startBootstrapApp } from "../../../environment-helpers/bootstrap-app"
|
||||
import { useApi } from "../../../environment-helpers/use-api"
|
||||
import adminSeeder from "../../../helpers/admin-seeder"
|
||||
import { AxiosInstance } from "axios"
|
||||
|
||||
jest.setTimeout(50000)
|
||||
|
||||
@@ -27,7 +24,7 @@ describe("POST /admin/users", () => {
|
||||
})
|
||||
|
||||
beforeEach(async () => {
|
||||
await adminSeeder(dbConnection)
|
||||
await createAdminUser(dbConnection, adminHeaders)
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { initDb, useDb } from "../../../environment-helpers/use-db"
|
||||
|
||||
import { AxiosInstance } from "axios"
|
||||
import { IUserModuleService } from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||
import { createAdminUser } from "../../helpers/create-admin-user"
|
||||
import { getContainer } from "../../../environment-helpers/use-container"
|
||||
import path from "path"
|
||||
import { startBootstrapApp } from "../../../environment-helpers/bootstrap-app"
|
||||
import { useApi } from "../../../environment-helpers/use-api"
|
||||
import adminSeeder from "../../../helpers/admin-seeder"
|
||||
import { AxiosInstance } from "axios"
|
||||
|
||||
jest.setTimeout(50000)
|
||||
|
||||
@@ -31,7 +31,7 @@ describe("DELETE /admin/users/:id", () => {
|
||||
})
|
||||
|
||||
beforeEach(async () => {
|
||||
await adminSeeder(dbConnection)
|
||||
await createAdminUser(dbConnection, adminHeaders)
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { initDb, useDb } from "../../../environment-helpers/use-db"
|
||||
|
||||
import { AxiosInstance } from "axios"
|
||||
import { IUserModuleService } from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||
import { createAdminUser } from "../../helpers/create-admin-user"
|
||||
import { getContainer } from "../../../environment-helpers/use-container"
|
||||
import path from "path"
|
||||
import { startBootstrapApp } from "../../../environment-helpers/bootstrap-app"
|
||||
import { useApi } from "../../../environment-helpers/use-api"
|
||||
import adminSeeder from "../../../helpers/admin-seeder"
|
||||
import { AxiosInstance } from "axios"
|
||||
|
||||
jest.setTimeout(50000)
|
||||
|
||||
@@ -31,7 +31,7 @@ describe("GET /admin/users", () => {
|
||||
})
|
||||
|
||||
beforeEach(async () => {
|
||||
await adminSeeder(dbConnection)
|
||||
await createAdminUser(dbConnection, adminHeaders)
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { initDb, useDb } from "../../../environment-helpers/use-db"
|
||||
|
||||
import { AxiosInstance } from "axios"
|
||||
import { IUserModuleService } from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||
import { createAdminUser } from "../../helpers/create-admin-user"
|
||||
import { getContainer } from "../../../environment-helpers/use-container"
|
||||
import path from "path"
|
||||
import { startBootstrapApp } from "../../../environment-helpers/bootstrap-app"
|
||||
import { useApi } from "../../../environment-helpers/use-api"
|
||||
import adminSeeder from "../../../helpers/admin-seeder"
|
||||
import { AxiosInstance } from "axios"
|
||||
|
||||
jest.setTimeout(50000)
|
||||
|
||||
@@ -31,7 +31,7 @@ describe("GET /admin/users/:id", () => {
|
||||
})
|
||||
|
||||
beforeEach(async () => {
|
||||
await adminSeeder(dbConnection)
|
||||
await createAdminUser(dbConnection, adminHeaders)
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { initDb, useDb } from "../../../environment-helpers/use-db"
|
||||
|
||||
import { AxiosInstance } from "axios"
|
||||
import { IUserModuleService } from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||
import { createAdminUser } from "../../helpers/create-admin-user"
|
||||
import { getContainer } from "../../../environment-helpers/use-container"
|
||||
import path from "path"
|
||||
import { startBootstrapApp } from "../../../environment-helpers/bootstrap-app"
|
||||
import { useApi } from "../../../environment-helpers/use-api"
|
||||
import adminSeeder from "../../../helpers/admin-seeder"
|
||||
import { AxiosInstance } from "axios"
|
||||
|
||||
jest.setTimeout(50000)
|
||||
|
||||
@@ -31,7 +31,7 @@ describe("POST /admin/users/:id", () => {
|
||||
})
|
||||
|
||||
beforeEach(async () => {
|
||||
await adminSeeder(dbConnection)
|
||||
await createAdminUser(dbConnection, adminHeaders)
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
|
||||
Reference in New Issue
Block a user