Return after a profile edit
Send customers to their hosted Unidy profile and bring them back to your application.
Use a Change my data link to open Unidy's hosted /profile page and return the customer to your application after a successful save. The hosted profile and Profile Cockpit are the same customer page.
This integration needs a URL and an approved return destination. Ask your Unidy contact to enable the profile-return feature for your instance if it is not yet available.
Allow the return destination
A target is accepted if it matches either the effective External Redirect Hosts list or Allowed Hosts on an SDK client associated with the current brand.
- Manage tenant-wide external targets under Auth → Security → Account & Access. Brand-specific external redirect hosts under Customization → Security also contribute to the effective list.
- Manage SDK-client entries under Integrations → API → SDK Clients. See Manage SDK app credentials.
Use full URIs, including their schemes. The matching rules are:
| Entry | Accepted targets |
|---|---|
https://app.example.com | Any path on that HTTPS host. A trailing / has the same effect. |
https://*.example.com | The apex example.com and its subdomains over HTTPS. |
https://app.example.com/portal | /portal and its child paths, such as /portal/account; not /portals or /other. |
https://app.example.com:8443 | That nondefault port; a different port needs a matching entry. |
myapp://profile-done | The matching native-app scheme and host. |
http://localhost:3000 | Local development on that origin and port. |
The scheme and host must match, unless the host uses the explicit *. pattern. An HTTP target does not match an HTTPS entry. Paths containing dot segments or encoded separators that could escape a restriction are rejected. javascript:, data:, vbscript:, file:, blob:, and about: are rejected regardless of configuration. Keep entries narrow and use only schemes your application owns.
You can configure multiple destinations, but each profile link carries one return_to value. Saved allowlist changes take effect without an application deploy or restart.
Build the profile link
Pass the complete absolute return URL to /profile:
https://accounts.example.com/profile?return_to=https%3A%2F%2Fapp.example.com%2Faccount&return_to_name=Acme%20Portal| Parameter | Contract |
|---|---|
return_to | Required for this behavior. An absolute URL with a scheme, at most 2048 characters. Relative values such as /account are rejected. |
return_to_name | Optional application label for Back to Acme Portal, limited to 60 characters. Without it, Unidy uses the target host, or Back to the app for a custom app scheme. |
Encode the whole target value so its query parameters and fragment remain part of the destination. Build it yourself; there is no dedicated SDK helper:
const profile = new URL('/profile', 'https://accounts.example.com');
profile.searchParams.set('return_to', 'https://app.example.com/account?tab=data#saved');
profile.searchParams.set('return_to_name', 'Acme Portal');
window.location.assign(profile.href);Put these parameters on /profile itself. The customer needs a Unidy browser session and will be asked to sign in if necessary. A native app can first create a one-time login handoff, using a path such as:
{
"path": "/profile?return_to=https%3A%2F%2Fapp.example.com%2Faccount&return_to_name=Acme%20Portal"
}Mint and redeem that handoff only when the customer navigates; its ten-second lifetime is separate from the return target's lifetime.
What the customer sees
An accepted target displays a Back to … banner. It remains available on pages with the standard Unidy header, so a customer visiting tickets or newsletters can still return.
| Action | Result |
|---|---|
| First successful profile save | Redirects to the target and consumes it. Subsequent saves stay in Unidy unless the customer opens a new profile-return link. |
| Save fails validation | Redisplays the errors and keeps the banner and target for the next successful save. |
| Follow the banner link | Returns without saving; the stored target remains available for a later save. |
| Dismiss the banner with × | Clears the target. |
Save during an OAuth connection with oauth_application_id | The OAuth connection decides the next destination instead of the profile-return target. |
The target lasts one hour from opening the link. It is stored in an encrypted, HTTP-only browser cookie and bound to the user who opened it. It is not shared across browsers or devices, and a different user signing in in that browser cannot use it. No server-side return-target record is created.
An invalid target leaves normal profile editing available. Customers normally see no banner or redirect for that rejected link; authorized administrators can receive an invalid-target message for diagnosis. A previously stored valid target is not replaced by an invalid one.
Troubleshoot the return
| Symptom | Check |
|---|---|
| No banner or return after save | Verify feature availability and the scheme, host, subdomain pattern, port, and allowed path. Check the SDK client's brand association if using its list. |
| Works in production but not locally | Add the full development origin including its port. |
| Target parameters or fragment disappear | Encode the complete return_to value with URLSearchParams. |
Target is /account and nothing happens | Supply the full absolute URL. |
| Parameters on another hosted page have no effect | Open /profile with those parameters. |
| Banner disappears or the second save stays in Unidy | The target may have expired, been consumed, or been dismissed. Open a new profile-return link. |
| Save returns to an OAuth connection | Complete that connection; its destination takes precedence. |
| A later Unidy page shows Profile updated | The confirmation can remain for the next Unidy visit after the external redirect. Show an appropriate confirmation in your own application. |
Test an allowed return, a rejected target, a validation failure, dismissal, and the one-time save behavior with a test customer before release. For customer profile settings, see Login and registration settings.