ppinto
April 25, 2025, 6:36am
1
When setting up email 2FA, users are prompted to confirm the email address from their user table record. The same happens when passing through 2FA subsequently.
I want to keep users from changing that email address. How can I bypass that prompt and just use the email in the user record?
Or, as an alternative, is there a way to make that input read only?
Thanks!
arbei
April 25, 2025, 8:39am
2
You may add some CSS to hide the icons that can change the email address.
ppinto
April 25, 2025, 10:32am
3
I want to block changes to this input, forcing whatever email is set in the database user:
I can add this:
$("#swal2-input").prop("readonly", true);
But I don’t know where to add it to the project.
ppinto
April 28, 2025, 1:21pm
4
I’ve managed to find where to tinker to achieve this, in js/ew.js, lines 7005 and following:
// Send OTP and Verify
let url = getApiUrl([ew.API_2FA_ACTION, ew.API_2FA_SHOW, ew.CURRENT_USER_IDENTIFIER, authType]),
html = sameText(authType, "email") ? ew.language.phrase("EnterOTPEmailAddress") : ew.language.phrase("EnterOTPPhoneNumber");
$$1.get(url, result => {
var _result$error7;
if (result.success) {
_prompt({
html: html,
input: "text",
inputAttributes: { //added code
readonly: true //added code
}, //added code
inputValue: result.account,
confirmButtonText: ew.language.phrase("SendOtp"),
...
But I’d like to avoid manhandling files after they are generated.
How can I do this then?
arbei
April 29, 2025, 2:51am
5
You may try to add CSS styles for the input: (enter it under HTML → Styles → User)
pointer-events: none;