Last active
March 17, 2021 17:47
-
-
Save joshcanhelp/f3bd076aa6f7bb3da8388dc3f45c6f9d to your computer and use it in GitHub Desktop.
Easy ULP modification with Netlify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
export AUTH0_API2_TOKEN="Your management API token goes here" | |
export AUTH0_API2_DOMAIN="Your tenant domain goes here" | |
# https://cli.netlify.com/ | |
alias sync_ulp='netlify deploy --prod --dir . && curl --request PUT \ | |
--data "@./index.html" \ | |
--header "authorization: Bearer $AUTH0_API2_TOKEN" \ | |
--url "https://$AUTH0_API2_DOMAIN/api/v2/branding/templates/universal-login" \ | |
--header "content-type: text/html"' | |
# ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
{%- auth0:head -%} | |
<link href="//elated-hawking-b7264a.netlify.app/ulp.css" rel="stylesheet" /> | |
<title>{{ prompt.screen.texts.pageTitle }}</title> | |
</head> | |
<body class="_widget-auto-layout"> | |
{%- auth0:widget -%} | |
<script src="//elated-hawking-b7264a.netlify.app/ulp.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background: rgb(255,221,221); | |
background: linear-gradient(158deg, rgba(255,221,221,1) 0%, rgba(245,217,217,1) 36%, rgba(215,255,229,1) 67%, rgba(207,255,224,1) 100%); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("JS loaded ✅"); | |
// Note: this only catches DB logins | |
const form = document.getElementsByTagName('form')[0]; | |
form.addEventListener('submit', pauseSubmit); | |
function pauseSubmit(event) { | |
event.preventDefault(); | |
console.log("Form submitted 💥"); | |
window.setTimeout(() => { | |
console.log("Onward ⏩"); | |
form.submit(); | |
}, 2000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Documentation for this feature:
https://auth0.com/docs/universal-login/new-experience/universal-login-page-templates