【问题标题】:How do I get Auth0 custom action to send Axios Requests如何获得 Auth0 自定义操作以发送 Axios 请求
【发布时间】:2021-12-31 13:22:29
【问题描述】:

我正在尝试使用带有 Auth0 的自定义操作通过 Worker 在我的 Cloudflare KV 中创建用户配置文件。我收到“请求失败,状态码为 503”的错误,并且没有来自 Cloudflare 的日志。我已确保已将 axios 添加为包等。但由于某种原因它无法正常工作,如果我在 Auth0 之外正常进行调用,它可以正常工作。

const axios = require("axios");

/**
 * @param {Event} event - Details about registration event.
 */
exports.onExecutePostUserRegistration = async (event) => {
  await axios.post("https://blahblahblah.com/createuser", { params: { "id": event.user.user_id,
  "name": event.user.name,
  "email": event.user.email,
  "image": event.user.picture }});     
};

更新:

我可以使用 cloudflare dev 域发送请求,所以我的域可能被阻止了?

现在只是值输出为空?

【问题讨论】:

    标签: javascript axios auth0


    【解决方案1】:

    这似乎是您服务器端的问题,您是否尝试过更改 Cloudflare 开发 URL?

    【讨论】:

    • 是的!谢谢,就是这样。
    猜你喜欢
    • 2021-06-08
    • 1970-01-01
    • 1970-01-01
    • 2013-05-24
    • 1970-01-01
    • 2013-05-31
    • 1970-01-01
    • 2020-07-11
    • 2017-12-04
    相关资源
    最近更新 更多