Skip to content

Instantly share code, notes, and snippets.

@saltukalakus
Last active July 18, 2022 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saltukalakus/059c559f9ea701de0297ecbca6e56d62 to your computer and use it in GitHub Desktop.
Save saltukalakus/059c559f9ea701de0297ecbca6e56d62 to your computer and use it in GitHub Desktop.
Auth0 classic MFA page with disabled country selection
<!DOCTYPE html>
<html>
<head>
<title>2nd Factor Authentication</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<style type="text/css">
html, body { padding: 0; margin: 0; }
.table {
display: table;
position: absolute;
height: 100%;
width: 100%;
background-color: {{ pageBackgroundColor | default: '#2b2b33' }};
}
.cell {
display: table-cell;
vertical-align: middle;
}
.content {
padding: 25px 0px 25px 0px;
margin-left: auto;
margin-right: auto;
width: 280px; /* login widget width */
}
</style>
</head>
<body>
<div class="table">
<div class="cell">
<div class="content">
<!-- WIDGET -->
<div class="js-mfa-container mfa-container" id="container"></div>
</div>
</div>
</div>
<script src="//cdn.auth0.com/js/mfa-widget/mfa-widget-1.8.6.min.js"></script>
<script>
(function() {
return new Auth0MFAWidget({
container: "container",
defaultLocation : ['Australia', 'AU', '+61'],
theme: {
icon: "{{ iconUrl | default: '//cdn.auth0.com/styleguide/1.0.0/img/badge.png' }}",
primaryColor: "{{ primaryColor | default: '#ea5323' }}"
},
requesterErrors: [
{% for error in errors %}
{ message: "{{ error.message }}", errorCode: "{{ error.code }}" }
{% endfor %}
],
mfaServerUrl: "{{ mfaServerUrl }}",
{% if ticket %}
ticket: "{{ ticket }}",
{% else %}
requestToken: "{{ requestToken }}",
{% endif %}
postActionURL: "{{ postActionURL }}",
userData: {
userId: "{{ userData.userId }}",
email: "{{ userData.email }}",
friendlyUserId: "{{ userData.friendlyUserId }}",
tenant: "{{ userData.tenant }}",
{% if userData.tenantFriendlyName %}
tenantFriendlyName: "{{ userData.tenantFriendlyName }}"
{% endif %}
},
globalTrackingId: "{{ globalTrackingId }}",
{% if allowRememberBrowser %}allowRememberBrowser: {{ allowRememberBrowser }}, {% endif %}
{% if stateCheckingMechanism %}stateCheckingMechanism: "{{ stateCheckingMechanism }}", {% endif %}
});
})();
async function hideCountryCode() {
if (document.getElementsByClassName('auth0-lock-input-location')[0]) {
document.getElementsByClassName('auth0-lock-input-location')[0].style.display = 'none'
clearInterval(hideCountryCodeLoop);
}
}
var hideCountryCodeLoop = setInterval(hideCountryCode, 100);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment