You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m running into an issue while setting up the medusa-plugin-resend in my MedusaJS project. The specific error I'm encountering is related to CORS:
No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Hope somebody can help me with this
const requestPasswordReset = useAdminSendResetPasswordToken()
const handleSubmit = async (e: { preventDefault: () => void }) => {
e.preventDefault()
setIsLoading(true)
try {
// Request password reset token from Medusa
await requestPasswordReset.mutateAsync({ email })
await resend.emails.send({
from: "Your Store <[email protected]>",
to: email,
subject: "Reset Your Password",
html: `
<p>Hello,</p>
<p>You have requested to reset your password. Click the link below to set a new password:</p>
<p><a href="https:url/reset-password?email=${email}">Reset Password</a></p>
<p>If you didn't request this, you can safely ignore this email.</p>
<p>Best regards,<br>Your Store Team</p>
`,
})
setMessage(
"If an account exists with this email, a reset link has been sent."
)
} catch (error) {
console.error("Error:", error)
setMessage(
"If an account exists with this email, a reset link has been sent."
)
} finally {
setIsLoading(false)
}
}`
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I’m running into an issue while setting up the medusa-plugin-resend in my MedusaJS project. The specific error I'm encountering is related to CORS:
No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Hope somebody can help me with this
medusa-config.js
Beta Was this translation helpful? Give feedback.
All reactions