commit
3b0efa8926
3 changed files with 17 additions and 9 deletions
2
.github/workflows/on-release-published.yml
vendored
2
.github/workflows/on-release-published.yml
vendored
|
|
@ -36,7 +36,7 @@ jobs:
|
|||
uses: grafana/shared-workflows/actions/get-vault-secrets@main
|
||||
with:
|
||||
repo_secrets: |
|
||||
GRAFANA_ACCESS_POLICY_TOKEN=github_actions:cloud-access-policy-token
|
||||
GRAFANA_ACCESS_POLICY_TOKEN=grafana_cloud_access_policy_token:value
|
||||
GCS_PLUGIN_PUBLISHER_SERVICE_ACCOUNT_JSON=github_actions:gcs-plugin-publisher
|
||||
- name: Build, sign, and package plugin
|
||||
id: build-sign-and-package-plugin
|
||||
|
|
|
|||
|
|
@ -926,7 +926,7 @@ if IS_OPEN_SOURCE:
|
|||
} # noqa
|
||||
|
||||
# RECAPTCHA_V3 settings
|
||||
RECAPTCHA_V3_SITE_KEY = os.environ.get("RECAPTCHA_SITE_KEY", default="6LeIPJ8kAAAAAJdUfjO3uUtQtVxsYf93y46mTec1")
|
||||
RECAPTCHA_V3_SITE_KEY = os.environ.get("RECAPTCHA_SITE_KEY", default=None)
|
||||
RECAPTCHA_V3_SECRET_KEY = os.environ.get("RECAPTCHA_SECRET_KEY", default=None)
|
||||
RECAPTCHA_V3_ENABLED = os.environ.get("RECAPTCHA_ENABLED", default=False)
|
||||
RECAPTCHA_V3_HOSTNAME_VALIDATION = os.environ.get("RECAPTCHA_HOSTNAME_VALIDATION", default=False)
|
||||
|
|
|
|||
|
|
@ -108,10 +108,7 @@ export const PhoneVerification = observer((props: PhoneVerificationProps) => {
|
|||
await UserHelper.verifyPhone(userPk, code);
|
||||
userStore.fetchItemById({ userPk });
|
||||
} else {
|
||||
window.grecaptcha.ready(async function () {
|
||||
const token = await window.grecaptcha.execute(rootStore.recaptchaSiteKey, {
|
||||
action: 'mobile_verification_code',
|
||||
});
|
||||
async function start_verification(token) {
|
||||
await userStore.updateUser({
|
||||
pk: userPk,
|
||||
email: user.email,
|
||||
|
|
@ -121,20 +118,31 @@ export const PhoneVerification = observer((props: PhoneVerificationProps) => {
|
|||
switch (type) {
|
||||
case 'verification_call':
|
||||
await UserHelper.fetchVerificationCall(userPk, token);
|
||||
setState({ isPhoneCallInitiated: true });
|
||||
setState({isPhoneCallInitiated: true});
|
||||
if (codeInputRef.current) {
|
||||
codeInputRef.current.focus();
|
||||
}
|
||||
break;
|
||||
case 'verification_sms':
|
||||
await UserHelper.fetchVerificationCode(userPk, token);
|
||||
setState({ isCodeSent: true });
|
||||
setState({isCodeSent: true});
|
||||
if (codeInputRef.current) {
|
||||
codeInputRef.current.focus();
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!rootStore.recaptchaSiteKey?.trim()) {
|
||||
await start_verification(null)
|
||||
} else {
|
||||
window.grecaptcha.ready(async function () {
|
||||
const token = await window.grecaptcha.execute(rootStore.recaptchaSiteKey, {
|
||||
action: 'mobile_verification_code',
|
||||
});
|
||||
await start_verification(token);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue