【发布时间】:2021-12-18 01:25:12
【问题描述】:
我正在尝试编写一个身份验证阻止功能,以防止用户在 google 身份平台中从客户端创建帐户。我已经用打字稿写了它,但我正在努力部署它
这是一个关于拦截功能的网站https://cloud.google.com/identity-platform/docs/blocking-functions
我的实际功能是这样的
import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';
import * as gcipCloudFunctions from 'gcip-cloud-functions';
const authClient = new gcipCloudFunctions.Auth();
exports.beforeCreateBlockingFunction = authClient.functions().beforeCreateHandler((user, context) => {
throw new gcipCloudFunctions.https.HttpsError('invalid-argument', `Unauthorized email "${user.email}"`);
});
-
我的方法签名正确吗?
-
我正在尝试使用以下命令部署它。我不确定这是否适用于打字稿。这是正确的方法吗?
// Http trigger with Cloud Functions.
// gcloud functions deploy beforeCreateBlockingFunction --runtime nodejs10 --region europe-west1 --trigger-http --allow-unauthenticated
感谢任何帮助。 亲切的问候
【问题讨论】:
标签: node.js typescript google-cloud-platform google-identity google-identity-toolkit