Login View
The Login View is a credential-based login form. It is generated when an endpoint is annotated with x-uigen-login: true in the spec. This is used for APIs that require a username/password login to obtain a token.
When it appears
The Login View appears when:
- The spec has a
securitySchemesentry requiring authentication - At least one endpoint is annotated with
x-uigen-login: true
Without the annotation, UIGen renders a token input form instead (for Bearer/API Key schemes).
Features
- Auto-generated fields: the form fields are derived from the login endpoint's
requestBodyschema - Token extraction: after a successful login, UIGen extracts the token from the response using the
x-uigen-token-pathannotation - Session storage: the token is stored in session storage and injected into subsequent API requests via the proxy
- Error handling: login errors are displayed inline
Example
See Credential Login for a full example with YAML annotations.
Customisation
Replace the Login View:
overrideRegistry.register({
id: 'auth.login',
mode: 'component',
component: MyCustomLoginForm,
});