Implement Shopify Provider

This commit is contained in:
cond0r
2021-02-04 13:23:44 +02:00
parent c06d9dae3a
commit 14c3f961b3
61 changed files with 16405 additions and 20 deletions

View File

@@ -0,0 +1,38 @@
import { FetcherError } from '@commerce/utils/errors'
import type { LoginHandlers } from '../login'
const loginHandler: LoginHandlers['login'] = async ({
res,
body: { email, password },
config,
}) => {
if (!(email && password)) {
return res.status(400).json({
data: null,
errors: [{ message: 'Invalid request' }],
})
}
try {
} catch (error) {
// Check if the email and password didn't match an existing account
if (error instanceof FetcherError) {
return res.status(401).json({
data: null,
errors: [
{
message:
'Cannot find an account that matches the provided credentials',
code: 'invalid_credentials',
},
],
})
}
throw error
}
res.status(200).json({ data: null })
}
export default loginHandler

View File

@@ -0,0 +1 @@
export default function () {}

View File

@@ -0,0 +1 @@
export default function () {}

View File

@@ -0,0 +1 @@
export default function () {}

View File

@@ -0,0 +1 @@
export default function () {}