
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
auth0-editprofile-widget
Advanced tools
This widget provides a way to allow users to update their own profile. It uses the user token to update the user metadata.
Check the demo: http://auth0.github.io/auth0-editprofile-widget/
email
Add the auth0-editprofile-widget.min.js
dependency, set up the form layout and initialize the widget with the user token:
<div id="editProfileContainer"></div>
<script src="build/auth0-editprofile-widget.min.js"></script>
<script type="text/javascript">
var editProfileWidget = new Auth0EditProfileWidget(auth0_domain, 'editProfileContainer', [
{ label: "Name", type:"text", attribute:"name",
validation: function(name){
return (name.length > 10 ? 'The name is too long' : null);
}
},
{ label: "Lastname", type:"text", attribute:"lastname" },
{ label: "BirthDay", type:"date", attribute:"birthday" },
{ label: "Type", type:"select", attribute:"account_type",
options:[
{ value: "type_1", text:"Type 1"},
{ value: "type_2", text:"Type 2"},
{ value: "type_3", text:"Type 3"}
]
}
]);
editProfileWidget.init(user_token);
</script>
Parameters:
field_${type}_${attribute}
but having several fields form the same tuple (attribute,type) will provide an id collition.The form will be rendered when it is initialized and will request the user data when the init method is called with the logged in user token.
By default this widget provides a way to update the user_metadata
using the user token. Since to update the app_metadata
and root attributes an app_token
is needed, it shouldn't be done on client side.
In this case, you need to implement your own connection strategy that will make a request to your backend and from there update the user data. You can also use the built-in connection strategy and webtask provided by the plugin in case you are working in a backendless app.
Create the webtask and copy the webtask URL to set as the WebtaskStrategy parameter:
wt create --name update_user_profile \
--secret app_token=... \
--secret client_secret=... \
--secret domain=... \
--output url update_user_profile.js --no-parse --no-merge
read:users
, update:users
and update:users_app_metadata
scopesand set the connection_strategy
:
var editProfileWidget = new Auth0EditProfileWidget('editProfileContainer',
{
connection_strategy: new WebtaskStrategy('https://yourendpoint...')
},
...
Connecting to an existing backend can have special requirements and different ways to call the API endpoint. In this case, you have the posibility to create your own connection strategy.
The connection strategy is an object that provides 2 methods:
You can see the strategies provided by the widget as an example:
user_metadata
.This widget support the ability to add custom fields in order to render your own controls. For example:
...
{ id:"customName", type:"custom", attribute:"name", render: function(value) {
return '<div class="custom-field">Hi <b>'+value+'</b>, How you doing?</div>';
} },
...
This field will show a greeting showing dinamically the user name.
Calling the updateFieldById
method, allows you to update other fields settings in order to update their value or settings.
editProfileWidget.updateFieldById('customName', {
value:"New Name"
});
Prameters:
Auth0 helps you to:
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
This project is licensed under the MIT license. See the LICENSE file for more info.
FAQs
Auth0 Edit Profile widget.
We found that auth0-editprofile-widget demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.