Unify Logo Footer.svg
Unify Applications
Logo
User & Auth Actions

User & Auth Actions

Logo

5 mins READ

Actions at a Glance

Most user and auth operations are unified under the controlUser action. The builder exposes them through a User Action dropdown. The login action is separate and used specifically for the sign-in page.

Action TypeUser Action ValueBuilder LabelUse When
loginLoginSign-in page: SSO redirect or password form submission
controlUserlogoutControl User → LogoutSign the current user out
controlUserrefreshUserContextControl User → Refresh User ContextRe-fetch user details after a backend change
controlUsersignInWithSSOControl User → Sign In with SSOMobile only: trigger SSO login in system browser
controlUsersetLanguageControl User → Set LanguageSwitch the app's language/locale
controlUsersetThemeControl User → Set Color SchemeSwitch between light, dark, or system color scheme
controlUsersetInterfaceThemeControl User → Set ThemeSwitch the active interface theme
controlUsersetUserPreferenceControl User → Set User PreferenceSave an arbitrary user preference key-value

login — Login

Signs the current user in against a chosen identity provider. Handles both SAML SSO redirect and password form submission. Used on sign-in pages only — both paths trigger a full-page navigation, so no follow-up action in the chain will run after login starts.

Parameters

ParameterTypeRequiredDefaultDescription
method"sso" | "password"Optional (optional)sso redirects to the SAML begin-login endpoint. password posts the form to /auth/login. Any other value is a no-op.
identityProviderIdstringRequired (required)The identity provider to authenticate against. If missing, the action silently does nothing — no redirect, no form post, no message.

Warning: Login is a full-page navigation. Both paths trigger a full-page redirect. Any unsaved page state is lost and no later action in the same chain runs after login fires. Web only — mobile uses controlUser → signInWithSSO instead.

Note: Post-login destination: The action reads returnTo from the current URL and passes it through so the user lands back where they started. Use /login?returnTo=/dashboard to redirect after authentication.

Examples

SSO login from a Sign In button

{ "actionType": "login", "payload": { "method": "sso", "identityProviderId": "idp_company_saml" } }

Password login from a form submit

{ "actionType": "login", "payload": { "method": "password", "identityProviderId": "idp_local_password" } }

controlUser → Logout

Ends the current user's session. On web it signs out on the server and navigates to the home path /. On mobile it clears the stored session and returns to the logged-out screen.

Parameters

ParameterTypeRequiredDefaultDescription
userControlAction"logout"Required (required)Must be the exact string "logout".

Note: Mobile biometrics: On mobile, if biometric login is enrolled the logout is "soft" — enough state is kept for biometric re-authentication. Without biometrics it's a "hard" logout that wipes all stored data.

Sign out button

{ "actionType": "controlUser", "payload": { "userControlAction": "logout" } }

controlUser → Refresh User Context

Re-fetches the signed-in user's details and refreshes all bindings that read {{ user.* }}. Use it after a backend operation that changes the user's profile, roles, or preferences — without requiring a re-login.

Refresh user context after updating profile

{ "actionType": "controlUser", "payload": { "userControlAction": "refreshUserContext" } }

controlUser → Sign In with SSO (Mobile)

On native mobile apps, opens a system browser to complete SSO authentication and starts a session. On web this action shows a warning and does nothing.

Parameters

ParameterTypeRequiredDefaultDescription
userControlAction"signInWithSSO"Required (required)Must be "signInWithSSO". Only available when app type is mobile.
identityProviderIdstringRequired (required)The identity provider to authenticate against.

Mobile SSO sign-in

{ "actionType": "controlUser", "payload": { "userControlAction": "signInWithSSO", "identityProviderId": "idp_company_saml" } }

controlUser → Set Language

Switches the app's language/locale for the signed-in user. On a private interface it saves the choice; on a public interface it holds the choice in page state. Switching to a right-to-left language may reload the app to relayout.

Parameters

ParameterTypeRequiredDefaultDescription
userControlAction"setLanguage"Required (required)Must be "setLanguage".
languagestring (locale)Required (required)"en-US"The locale to switch to. Must be one of the interface's allowed locales; unsupported locales are silently ignored.

Language selector button

{ "actionType": "controlUser", "payload": { "userControlAction": "setLanguage", "language": "{{ select_language['value'] }}" } }

controlUser → Set Color Scheme

Switches between light, dark, and system color schemes. Stored as userControlAction: "setTheme" (legacy name for backward compatibility).

Warning: Naming mismatch: "Set Color Scheme" in the builder stores userControlAction: "setTheme", NOT "setColorScheme". "Set Theme" (the interface theme picker) stores "setInterfaceTheme". Do not confuse the two.

Parameters

ParameterTypeRequiredDefaultDescription
userControlAction"setTheme"Required (required)Must be "setTheme" (legacy name for Set Color Scheme).
theme"light" | "dark" | "system"Required (required)Color scheme to apply. system follows the device/OS setting. The field is named theme (not colorScheme) for backward compatibility.

Dark mode toggle

{ "actionType": "controlUser", "payload": { "userControlAction": "setTheme", "theme": "dark" } }

controlUser → Set User Preference

Saves an arbitrary key-value preference for the signed-in user, scoped to this interface. Use it to persist any user choice that doesn't fit the built-in language, theme, or color scheme options.

Parameters

ParameterTypeRequiredDefaultDescription
userControlAction"setUserPreference"Required (required)Must be "setUserPreference".
keystringRequired (required)The preference key to write.
valueanyRequired (required)The value to store. Evaluated before saving. Supports bindings.
recordIdstringOptional (optional)Optional record ID the preference is scoped to.

Save a preferred view mode

{ "actionType": "controlUser", "payload": { "userControlAction": "setUserPreference", "key": "orders_view_mode", "value": "{{ toggle_viewMode['value'] }}" } }

User Action Values Quick Reference

Builder LabelStored userControlActionPlatform
Set User PreferencesetUserPreferenceWeb + Mobile
Set LanguagesetLanguageWeb + Mobile
Set Color SchemesetThemeWeb + Mobile
Set ThemesetInterfaceThemeWeb + Mobile
Refresh User ContextrefreshUserContextWeb + Mobile
LogoutlogoutWeb + Mobile
Check AuthcheckAuthMobile only
Sign In with SSOsignInWithSSOMobile only