fix(medusa): Use correct auth middleware in GET /store/auth (#2687)

* use correct authentication middleware

* remove guard from get-session since it's guarded by middleware doing the same check

* Add integration tests

* Create lazy-swans-agree.md

Co-authored-by: olivermrbl <oliver@mrbltech.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Philip Korsholm
2022-11-29 15:46:55 +01:00
committed by GitHub
co-authored by olivermrbl Oliver Windall Juhl
parent e18b59de66
commit 70a8d3450f
7 changed files with 148 additions and 58 deletions
@@ -3,13 +3,14 @@ import faker from "faker"
import { Connection } from "typeorm"
import {
CustomerGroupFactoryData,
simpleCustomerGroupFactory,
simpleCustomerGroupFactory
} from "./simple-customer-group-factory"
export type CustomerFactoryData = {
id?: string
email?: string
groups?: CustomerGroupFactoryData[]
password_hash?: string
}
export const simpleCustomerFactory = async (
@@ -29,6 +30,11 @@ export const simpleCustomerFactory = async (
email: data.email,
})
if (data.password_hash) {
c.password_hash = data.password_hash
c.has_account = true
}
const customer = await manager.save(c)
if (data.groups) {