Configure user actions for users
Learn how to write User Action queries that allow users to authenticate using csutom product pages.
Use the User Action resource to write queries in custom product page apps that enable users to authenticate. Users can also perform additional actions, such as resetting their password or claiming an invitation. The User Action resource can also retrieve a list of apps and folders for which the user has access.
1. Create a resource query
You create user action queries in the same way as other resource queries:
- Click to open the Code panel.
- Click + and select Resource query.
- Select the User Action resource.
2. Select the action to perform
The User Action resource supports the following actions:
- Log in.
- Log out.
- Claim invitation.
- Send password reset email.
- Confirm reset password.
- Get user apps and folders.
The query displays additional options for you to configure when selecting an action.
Log in
The Log in action authenticates the user. The User Action resource supports username and password credentials and any configured single sign-on (SSO) identity provider. Select the method to use for authentication.
SSO authentication is handled by your identity provider and no additional configuration is needed. If you select Username and password, reference input component values for these credentials.
For example, if your app has an Email component (EmailInput
) and a Password component (PasswordInput
), you would reference these values using usernameInput.value
and passwordInput.value
respectively.
Log out
The Log out action logs the current user out. The user will then need to log in again.
Claim invitation
The Claim invitation action enables invited users to create an account. The action automatically validates the invite token that is included as a URL parameter in the invite link.
The action includes a number of options the user provides to claim their invite. You must add the necessary input components and reference their values so the user can provide this information.
Input field | Description |
---|---|
First name | The first name of the user. |
Last name | The last name of the user. |
Password | The password to use. |
User attributes | User attributes are key-value pairs of additional information you can store for users. |
Send password reset email
You can use the Send reset password email action to support password reset flows. You can use these actions within your same login app, e.g., by adding a new view to your container, or by creating a dedicated page for password resets and linking to it from your login page.
The Send reset password email user action automatically validates the password reset token and email address passed as URL parameters.
Confirm reset password
Use the Confirm reset password action to allow users to change their password after requesting a password reset.
This action automatically validates the password reset token and email address that were included as URL parameters in the reset password link. Reference a Password component for the New password option so that the user can input their new password.
Get user apps and folders
The Get user apps and folders action retrieves a list of all apps and folders for which the authenticated user has access. This is useful for providing users with a list of relevant apps to access.
The query results include two arrays of objects, apps
and folders
, with details about apps and folders. You can reference either of these arrays from a component that supports mapped options. For example, you could use the Navigation component to automatically display a list of all accessible apps for the current user.
3. Configure event handlers
User action queries do not automatically run. You must configure event handlers to trigger them in response to a user action, such as clicking a button.