dash.auth
Customer authentication methods.
Updated
On this page
dash.auth
Properties
dash.auth.customer // Customer | null
dash.auth.token // string | null
dash.auth.refreshToken // string | null
dash.auth.isAuthenticated // boolean
Authentication Methods
await dash.auth.requestOTP("email@example.com", { accepts_marketing: true })
const { customer } = await dash.auth.verifyOTP({ email: "...", code: "123456" })
const { customer } = await dash.auth.login({ email: "...", password: "..." })
await dash.auth.setPassword("newPassword123!")
await dash.auth.requestPasswordReset("email@example.com")
await dash.auth.resetPassword({ email: "...", code: "...", password: "..." })
await dash.auth.refreshAccessToken()
dash.auth.setToken(accessToken, refreshToken)
await dash.auth.logout()
Profile Methods
const { customer } = await dash.auth.getProfile()
const { customer } = await dash.auth.updateProfile({ first_name: "Jane" })
const { customer } = await dash.auth.updateMetadata({ key: "value" })
Order Methods
const { orders } = await dash.auth.getOrders({ limit: 10 })
const { order } = await dash.auth.getOrder("ord_abc")
Other Methods
const { banned } = await dash.auth.checkBan()
await dash.auth.mergeCart("cart_xyz")
See Authentication for full details.