WebRADDocumentationExplore WebRAD ↗
WEBRAD / TECHNICAL REFERENCE

Login

RestGo email/password login, registration, and password recovery in a Panel or Popup.

WebLoginAuthenticationVisual7 events

Quick start

Add Login1 in the Designer. Use the example in a page method.

Login1 · event
// Enable and configure the project RestGo connection first.
Login1.email = 'user@example.com';
Login1.remember = false;
Login1.showLogin();
Login1.controls.email.focus();
// Login1.showRegistration();
// Login1.showRecovery();
// Login1.close();

Configure Login

  1. Enable RestGo integration and configure Connection for the project.
  2. Drag Login from Authentication onto a page or reusable component.
  3. Double-click it or choose Login configuration → Configure Login in the Inspector.
  4. In Behavior, choose Panel or Popup, the initial form, registration, Remember me, password visibility, and closing behavior.
  5. In Fields and Texts, edit labels, placeholders, and feedback. English and Brazilian Portuguese presets replace the draft text.
  6. In Styles, assign existing compatible project Styles to the internal controls. Use the ordinary Styles workspace to edit their appearance.
  7. Configure Recovery, review Desktop/Mobile and form previews, and save the modal.

The internal fields and buttons are managed by the modal. Each placement keeps its own form state. Panel follows ordinary container layout; Popup opens a modal dialog. Disable Open Popup when the component is shown to open it explicitly with showLogin(), showRegistration(), or showRecovery().

Authentication and registration

Public registration must be enabled on the RestGo server. Activation, password policy, and permission to log in follow that server's settings. By default, successful registration returns to sign-in with the email retained. Sign in after registration requests login after account creation.

Remember me requests the corresponding session lifetime. Browser persistence follows the project's Connection settings. OnLogin also reports server-validated restored sessions. Use Interaction → OnLogin to navigate after authentication.

Password recovery

Enable recovery to show Forgot your password?. The email form requests a reset link. Its success message does not confirm that an account exists or that email was delivered.

The email returns to the application or the configured HTTP(S) return URL. That destination needs a Login with recovery enabled. With automatic links enabled, the component opens the new-password form. A successful reset returns to sign-in; it does not start a session. Expired links and server errors appear in the form.

Runtime behavior

  • email and remember prefill the form; busy and open are read-only state.
  • showLogin(), showRegistration(), and showRecovery() select and open a form. submit() sends the current form; close() dismisses it.
  • controls exposes typed runtime controls. Obtain these references again after changing the view or configuration.
  • Events contain user/status data without passwords or tokens. OnRegister confirms account creation; OnLogin confirms authentication.
  • Changing configuration in code affects that instance. Save in the modal to persist project changes.

More examples

Navigate after a successful login
Navigate after a successful login
import type { WebLogin, WebLoginUserEvent } from '@webrad/runtime';
// Copy into the page class and link OnLogin in Interaction.
class Example {
  public Login1Login(
    sender: WebLogin,
    event: CustomEvent<WebLoginUserEvent>,
  ): void {
    console.log(event.detail.user.id, event.detail.restored);
    Navigate('Dashboard');
  }
}
Open a Popup explicitly
Open a Popup explicitly
// Choose Popup and disable Open Popup when the component is shown in the modal.
// Use this in a button's OnClick body.
Login1.showLogin();

Inspector properties

Component options and defaults. Fields without runtime access are configured in the Inspector.

Property / sourceType and optionsDefaultRuntime access
nameName · Identitystring—name
xLeft · Size & positionnumber0x
yTop · Size & positionnumber0y
widthWidth · Size & positionnumber420width
heightHeight · Size & positionnumber400height
itemWidthResponsive width · Responsive sizeFit content grows the item to its widest rendered child and preserves child intrinsic widths; minimum and maximum width remain limits.enumfixed stretch fit-content"fixed"Inspector / configuration
itemHeightResponsive height · Responsive sizeFit content grows the item to its lowest rendered child and preserves child intrinsic heights; minimum and maximum height remain limits.enumfixed stretch fit-content"fit-content"Inspector / configuration
itemMinWidthMinimum width · Responsive sizenumber0Inspector / configuration
itemMaxWidthMaximum width · Responsive sizenumbernullInspector / configuration
itemMinHeightMinimum height · Responsive sizenumber0Inspector / configuration
itemMaxHeightMaximum height · Responsive sizenumbernullInspector / configuration
itemGrowGrow · Responsive sizenumber0Inspector / configuration
itemShrinkShrink · Responsive sizeAllows fixed and stretch flow items to yield space. Fit-content keeps its intrinsic size so its children are not compressed.booleantrueInspector / configuration
itemAlignSelfItem alignment · Responsive sizeCross-axis alignment for this item in a row or column. Auto inherits the parent alignment; responsive cross-axis stretch retains its sizing behavior.enumauto start center end stretch"auto"Inspector / configuration
itemHorizontalAnchorHorizontal anchor · Anchors & offsetsenumstart center end stretch"start"Inspector / configuration
itemVerticalAnchorVertical anchor · Anchors & offsetsenumstart center end stretch"start"Inspector / configuration
itemLeftLeft inset · Anchors & offsetsnumber0Inspector / configuration
itemRightRight inset · Anchors & offsetsnumber0Inspector / configuration
itemTopTop inset · Anchors & offsetsnumber0Inspector / configuration
itemBottomBottom inset · Anchors & offsetsnumber0Inspector / configuration
marginMargin · SpacingOuter spacing on all four sides, in pixels. Row and column layouts include this spacing between components.number0margin
marginTopMargin top · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginTop
marginRightMargin right · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginRight
marginBottomMargin bottom · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginBottom
marginLeftMargin left · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginLeft
visibleVisible · Behaviorbooleantruevisible
collapseWhenHiddenCollapse when hidden · BehaviorRemoves the component from the layout while it is not visible.booleantruecollapseWhenHidden
enabledEnabled · Behaviorbooleantrueenabled
configurationLogin configuration · LoginConfigure login, registration and account recovery, text, internal project Styles, Panel or Popup, and RestGo behavior.login-configEditor: login-configurator{"version":1,"presentation":"panel","initialView":"login","allowRegistration":true,"showFullName":true,"requireFullName":true,"confirmPassword":true,"showRemember":true,"rememberDefault":false,"showPasswordToggle":true,"autoLoginAfterRegistration":false,"closeOnLogin":true,"openOnShow":true,"dismissible":true,"language":"en","recovery":{"enabled":true,"automaticLinks":true,"returnUrl":"","texts":{"forgotPassword":"Forgot your password?","requestTitle":"Recover your account","requestSubtitle":"Enter your email to receive a password reset link.","requestButton":"Send reset link","requestSent":"If the account is eligible for recovery, you will receive an email with instructions.","resetTitle":"Set a new password","resetSubtitle":"Enter and confirm your new password.","resetButton":"Save new password","passwordChanged":"Password changed. Sign in with your new password.","invalidLink":"The recovery link is invalid or expired. Request a new link.","backToLogin":"Back to sign in"}},"styles":{},"email":{"label":"Email","placeholder":"name@example.com"},"password":{"label":"Password","placeholder":""},"fullName":{"label":"Full name","placeholder":""},"passwordConfirmation":{"label":"Confirm password","placeholder":""},"texts":{"loginTitle":"Welcome back","loginSubtitle":"Sign in with your email and password.","registerTitle":"Create your account","registerSubtitle":"Enter your details to get started.","loginButton":"Sign in","registerButton":"Create account","switchToRegister":"New here? Create an account","switchToLogin":"Already have an account? Sign in","remember":"Remember me","showPassword":"Show password","hidePassword":"Hide password","close":"Close","busy":"Please wait…","registered":"Account created. Sign in with your email and password.","authenticated":"You are signed in.","passwordMismatch":"Passwords do not match.","unavailable":"Configure the project RestGo connection.","requestFailed":"Could not complete the request. Please try again."},"appearance":{"fontFamily":"Roboto, sans-serif","fontSize":14,"background":"var(--wr-theme-surface)","foreground":"var(--wr-theme-text)","backgroundEnd":"var(--wr-theme-surface-end)","heading":"var(--wr-theme-heading)","muted":"var(--wr-theme-text-muted)","border":"var(--wr-theme-border)","borderEnd":"var(--wr-theme-border-accent)","inputBackground":"var(--wr-theme-input)","primary":"var(--wr-theme-primary)","inputBackgroundEnd":"var(--wr-theme-input-end)","primaryEnd":"var(--wr-theme-accent)","focus":"var(--wr-theme-focus)","onPrimary":"var(--wr-theme-on-primary)","error":"var(--wr-theme-danger)","borderRadius":12,"padding":20,"gap":8,"maxWidth":420,"fieldHeight":36}}configuration
currentRowBindingsCurrent row · DataBind writable visual values to fields of this repeated row.current-row-bindingsEditor: current-row-bindings[]currentRowBindings

API in code

MemberSignatureAccess
configurationget configuration(): WebLoginConfiguration;Read and write
controlsget controls(): WebLoginControls;Read-only
styleCatalogThe compiler/Designer supplies project style classes; configuration stores only stable IDs.get styleCatalog(): readonly RuntimeComponentStyle[];Read and write
viewget view(): WebLoginView;Read and write
busyget busy(): boolean;Read-only
openget open(): boolean;Read-only
emailget email(): string;Read and write
rememberget remember(): boolean;Read and write
hasRecoveryTokenget hasRecoveryToken(): boolean;Read-only
enabledget enabled(): boolean;Read and write
visibleget visible(): boolean;Read and write

show

method
show(): void;
Example
Login1.show
Login1.show();

hide

method
hide(): void;
Example
Login1.hide
Login1.hide();

close

method
close(): void;
Example
Login1.close
Login1.close();

showLogin

method
showLogin(): void;
Example
Login1.showLogin
Login1.showLogin();

showRegistration

method
showRegistration(): void;
Example
Login1.showRegistration
Login1.showRegistration();

showRecovery

method
showRecovery(): void;
Example
Login1.showRecovery
Login1.showRecovery();

showPasswordReset

method
showPasswordReset(token: string): void;

The token remains private and is cleared on completion, replacement, hiding or disposal.

Example
Login1.showPasswordReset
// For an authored recovery integration; normally use automatic email links.
Login1.showPasswordReset('TOKEN-FROM-EMAIL-LINK');

submit

method
submit(): Promise<void>;

Runs the current form through the shared project RestGo client. Never exposes tokens.

Example
Login1.submit
await Login1.submit();

dispose

method
dispose(): void;
Example
Login1.dispose
// Call only when disposing of an instance whose lifecycle you control.
Login1.dispose();
Inherited members (22)
MemberSignatureAccess
currentRowBindingscurrentRowBindings: readonly WebCurrentRowBinding[];Read and write
elementreadonly element: TElement;Read-only
idreadonly id: string;Read-only
namereadonly name: string;Read-only
collapseWhenHiddencollapseWhenHidden: boolean;Read and write
xx: number;Read and write
yy: number;Read and write
widthwidth: number;Read and write
heightheight: number;Read and write
marginOuter spacing on all four sides, in pixels.margin: number;Read and write
marginTopmarginTop: number;Read and write
marginRightmarginRight: number;Read and write
marginBottommarginBottom: number;Read and write
marginLeftmarginLeft: number;Read and write
alignSelfalignSelf: RuntimeLayoutAlignSelf;Read and write
tabIndextabIndex: number;Read and write
backgroundColorbackgroundColor: string;Read and write
colorcolor: string;Read and write
borderColorborderColor: string;Read and write

focus

method
focus(options?: FocusOptions): void;

bindEvent

method
bindEvent(eventName: string, handler: WebComponentEventHandler<this> | null): () => void;

emit

method
emit(eventName: string, detail?: unknown): boolean;

Events

Link methods in Interaction. How to use events.

OnLogin

WebLoginUserEvent in event.detail · user, restored

A login or restored server-validated session. Credentials are never included.

Signature and example
Interaction → OnLogin
import type { WebLogin, WebLoginUserEvent } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Login1Login(
    sender: WebLogin,
    event: CustomEvent<WebLoginUserEvent>,
  ): Promise<void> {
    console.log(event.detail);
    const { user, restored } = event.detail;
    console.log(user, restored);
  }
}

OnRegister

WebLoginUserEvent in event.detail · user

RestGo created the account. This alone does not start a session.

Signature and example
Interaction → OnRegister
import type { WebLogin, WebLoginUserEvent } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Login1Register(
    sender: WebLogin,
    event: CustomEvent<WebLoginUserEvent>,
  ): Promise<void> {
    console.log(event.detail);
    const { user } = event.detail;
    console.log(user);
  }
}

OnRecoveryRequested

WebLoginRecoveryEvent in event.detail · email

RestGo accepted the request. This does not reveal account existence or prove email delivery.

Signature and example
Interaction → OnRecoveryRequested
import type { WebLogin, WebLoginRecoveryEvent } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Login1RecoveryRequested(
    sender: WebLogin,
    event: CustomEvent<WebLoginRecoveryEvent>,
  ): Promise<void> {
    console.log(event.detail);
    const { email } = event.detail;
    console.log(email);
  }
}

OnPasswordReset

Standard event (Event).

RestGo accepted the new password. Returns to login without starting a session.

Signature and example
Interaction → OnPasswordReset
import type { WebLogin } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Login1PasswordReset(
    sender: WebLogin,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}

OnError

WebLoginErrorEvent in event.detail · operation, message, code, status

Signature and example
Interaction → OnError
import type { WebLogin, WebLoginErrorEvent } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Login1Error(
    sender: WebLogin,
    event: CustomEvent<WebLoginErrorEvent>,
  ): Promise<void> {
    console.log(event.detail);
    const { operation, message, code, status } = event.detail;
    console.log(operation, message, code, status);
  }
}

OnViewChange

WebLoginViewEvent in event.detail · view

Signature and example
Interaction → OnViewChange
import type { WebLogin, WebLoginViewEvent } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Login1ViewChange(
    sender: WebLogin,
    event: CustomEvent<WebLoginViewEvent>,
  ): Promise<void> {
    console.log(event.detail);
    const { view } = event.detail;
    console.log(view);
  }
}

OnClose

Standard event (Event).

Signature and example
Interaction → OnClose
import type { WebLogin } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Login1Close(
    sender: WebLogin,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}
WebRAD · Atentor · Read in Markdown
Source code: 6a562bda75a0 (with local changes) · November 7, 2026

Search documentation

Type to search APIs, components, and events.