Skip to content

Commit 3b0efa8

Browse files
authored
Merge pull request #5452 from grafana/dev
Dev to main
2 parents 3ca0868 + cdb2946 commit 3b0efa8

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

.github/workflows/on-release-published.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
uses: grafana/shared-workflows/actions/get-vault-secrets@main
3737
with:
3838
repo_secrets: |
39-
GRAFANA_ACCESS_POLICY_TOKEN=github_actions:cloud-access-policy-token
39+
GRAFANA_ACCESS_POLICY_TOKEN=grafana_cloud_access_policy_token:value
4040
GCS_PLUGIN_PUBLISHER_SERVICE_ACCOUNT_JSON=github_actions:gcs-plugin-publisher
4141
- name: Build, sign, and package plugin
4242
id: build-sign-and-package-plugin

engine/settings/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ class BrokerTypes:
926926
} # noqa
927927

928928
# RECAPTCHA_V3 settings
929-
RECAPTCHA_V3_SITE_KEY = os.environ.get("RECAPTCHA_SITE_KEY", default="6LeIPJ8kAAAAAJdUfjO3uUtQtVxsYf93y46mTec1")
929+
RECAPTCHA_V3_SITE_KEY = os.environ.get("RECAPTCHA_SITE_KEY", default=None)
930930
RECAPTCHA_V3_SECRET_KEY = os.environ.get("RECAPTCHA_SECRET_KEY", default=None)
931931
RECAPTCHA_V3_ENABLED = os.environ.get("RECAPTCHA_ENABLED", default=False)
932932
RECAPTCHA_V3_HOSTNAME_VALIDATION = os.environ.get("RECAPTCHA_HOSTNAME_VALIDATION", default=False)

grafana-plugin/src/containers/UserSettings/parts/tabs/PhoneVerification/PhoneVerification.tsx

+15-7
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,7 @@ export const PhoneVerification = observer((props: PhoneVerificationProps) => {
108108
await UserHelper.verifyPhone(userPk, code);
109109
userStore.fetchItemById({ userPk });
110110
} else {
111-
window.grecaptcha.ready(async function () {
112-
const token = await window.grecaptcha.execute(rootStore.recaptchaSiteKey, {
113-
action: 'mobile_verification_code',
114-
});
111+
async function start_verification(token) {
115112
await userStore.updateUser({
116113
pk: userPk,
117114
email: user.email,
@@ -121,20 +118,31 @@ export const PhoneVerification = observer((props: PhoneVerificationProps) => {
121118
switch (type) {
122119
case 'verification_call':
123120
await UserHelper.fetchVerificationCall(userPk, token);
124-
setState({ isPhoneCallInitiated: true });
121+
setState({isPhoneCallInitiated: true});
125122
if (codeInputRef.current) {
126123
codeInputRef.current.focus();
127124
}
128125
break;
129126
case 'verification_sms':
130127
await UserHelper.fetchVerificationCode(userPk, token);
131-
setState({ isCodeSent: true });
128+
setState({isCodeSent: true});
132129
if (codeInputRef.current) {
133130
codeInputRef.current.focus();
134131
}
135132
break;
136133
}
137-
});
134+
}
135+
136+
if (!rootStore.recaptchaSiteKey?.trim()) {
137+
await start_verification(null)
138+
} else {
139+
window.grecaptcha.ready(async function () {
140+
const token = await window.grecaptcha.execute(rootStore.recaptchaSiteKey, {
141+
action: 'mobile_verification_code',
142+
});
143+
await start_verification(token);
144+
});
145+
}
138146
}
139147
},
140148
[

0 commit comments

Comments
 (0)