Last active
July 13, 2017 15:21
-
-
Save pushpabrol/250459562998a67c891676f668d15a92 to your computer and use it in GitHub Desktop.
Script to update the custom hosted login page per client in Auth0
This file contains hidden or 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
| var fs = require('fs'); | |
| var file = fs.readFileSync('path to file containing custom hosted login page', "utf8"); | |
| var client_id = '<client_id_of_app>'; | |
| var client_data = {}; | |
| client_data.custom_login_page = file; | |
| client_data.custom_login_page_preview = file; | |
| var tools = require('auth0-extension-tools'); | |
| tools.managementApi.getClient({ | |
| domain: 'tenant.auth0.com', | |
| clientId: 'management_api_client_id', | |
| clientSecret: 'management_api_client_secret' | |
| }) | |
| .then(function (client) { | |
| client.clients.update({ | |
| client_id: client_id | |
| }, client_data, function (error, client) { | |
| if (error) { | |
| console.log(error); | |
| } else { | |
| console.log(client); | |
| } | |
| }) | |
| }).catch(function (error) { | |
| console.log(error); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment