Login
RestGo email/password login, registration, and password recovery in a Panel or Popup.
Quick start
Add Login1 in the Designer. Use the example in a page method.
// 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
- Enable RestGo integration and configure Connection for the project.
- Drag Login from Authentication onto a page or reusable component.
- Double-click it or choose Login configuration → Configure Login in the Inspector.
- In Behavior, choose Panel or Popup, the initial form, registration, Remember me, password visibility, and closing behavior.
- In Fields and Texts, edit labels, placeholders, and feedback. English and Brazilian Portuguese presets replace the draft text.
- In Styles, assign existing compatible project Styles to the internal controls. Use the ordinary Styles workspace to edit their appearance.
- 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
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
// 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 / source | Type and options | Default | Runtime access |
|---|---|---|---|
nameName · Identity | string | — | name |
xLeft · Size & position | number | 0 | x |
yTop · Size & position | number | 0 | y |
widthWidth · Size & position | number | 420 | width |
heightHeight · Size & position | number | 400 | height |
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 size | number | 0 | Inspector / configuration |
itemMaxWidthMaximum width · Responsive size | number | null | Inspector / configuration |
itemMinHeightMinimum height · Responsive size | number | 0 | Inspector / configuration |
itemMaxHeightMaximum height · Responsive size | number | null | Inspector / configuration |
itemGrowGrow · Responsive size | number | 0 | Inspector / configuration |
itemShrinkShrink · Responsive sizeAllows fixed and stretch flow items to yield space. Fit-content keeps its intrinsic size so its children are not compressed. | boolean | true | Inspector / 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 & offsets | enumstart center end stretch | "start" | Inspector / configuration |
itemVerticalAnchorVertical anchor · Anchors & offsets | enumstart center end stretch | "start" | Inspector / configuration |
itemLeftLeft inset · Anchors & offsets | number | 0 | Inspector / configuration |
itemRightRight inset · Anchors & offsets | number | 0 | Inspector / configuration |
itemTopTop inset · Anchors & offsets | number | 0 | Inspector / configuration |
itemBottomBottom inset · Anchors & offsets | number | 0 | Inspector / configuration |
marginMargin · SpacingOuter spacing on all four sides, in pixels. Row and column layouts include this spacing between components. | number | 0 | margin |
marginTopMargin top · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value. | number | 0Derived from saved properties | marginTop |
marginRightMargin right · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value. | number | 0Derived from saved properties | marginRight |
marginBottomMargin bottom · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value. | number | 0Derived from saved properties | marginBottom |
marginLeftMargin left · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value. | number | 0Derived from saved properties | marginLeft |
visibleVisible · Behavior | boolean | true | visible |
enabledEnabled · Behavior | boolean | true | enabled |
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
| Member | Signature | Access |
|---|---|---|
configuration | get configuration(): WebLoginConfiguration; | Read and write |
controls | get controls(): WebLoginControls; | Read-only |
styleCatalogThe compiler/Designer supplies project style classes; configuration stores only stable IDs. | get styleCatalog(): readonly RuntimeComponentStyle[]; | Read and write |
view | get view(): WebLoginView; | Read and write |
busy | get busy(): boolean; | Read-only |
open | get open(): boolean; | Read-only |
email | get email(): string; | Read and write |
remember | get remember(): boolean; | Read and write |
hasRecoveryToken | get hasRecoveryToken(): boolean; | Read-only |
enabled | get enabled(): boolean; | Read and write |
visible | get visible(): boolean; | Read and write |
show
methodshow(): void;Example
Login1.show();hide
methodhide(): void;Example
Login1.hide();close
methodclose(): void;Example
Login1.close();showLogin
methodshowLogin(): void;Example
Login1.showLogin();showRegistration
methodshowRegistration(): void;Example
Login1.showRegistration();showRecovery
methodshowRecovery(): void;Example
Login1.showRecovery();openRecoveryLink
methodopenRecoveryLink(): boolean;Claims a pending email link without exposing its token to authored code.
Example
Login1.openRecoveryLink();showPasswordReset
methodshowPasswordReset(token: string): void;The token remains private and is cleared on completion, replacement, hiding or disposal.
Example
// For an authored recovery integration; normally use automatic email links.
Login1.showPasswordReset('TOKEN-FROM-EMAIL-LINK');submit
methodsubmit(): Promise<void>;Runs the current form through the shared project RestGo client. Never exposes tokens.
Example
await Login1.submit();dispose
methoddispose(): void;Example
// Call only when disposing of an instance whose lifecycle you control.
Login1.dispose();Inherited members (22)
| Member | Signature | Access |
|---|---|---|
currentRowBindings | currentRowBindings: readonly WebCurrentRowBinding[]; | Read and write |
element | readonly element: TElement; | Read-only |
id | readonly id: string; | Read-only |
name | readonly name: string; | Read-only |
x | x: number; | Read and write |
y | y: number; | Read and write |
width | width: number; | Read and write |
height | height: number; | Read and write |
marginOuter spacing on all four sides, in pixels. | margin: number; | Read and write |
marginTop | marginTop: number; | Read and write |
marginRight | marginRight: number; | Read and write |
marginBottom | marginBottom: number; | Read and write |
marginLeft | marginLeft: number; | Read and write |
alignSelf | alignSelf: RuntimeLayoutAlignSelf; | Read and write |
tabIndex | tabIndex: number; | Read and write |
backgroundColor | backgroundColor: string; | Read and write |
color | color: string; | Read and write |
borderColor | borderColor: string; | Read and write |
focus
methodfocus(options?: FocusOptions): void;bindEvent
methodbindEvent(eventName: string, handler: WebComponentEventHandler<this> | null): () => void;emit
methodemit(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
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
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
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
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
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
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
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);
}
}