Back to Consul

AuthForm

ui/packages/consul-ui/app/components/auth-form/README.mdx

1.22.71.5 KB
Original Source

AuthForm

AuthForm is a mostly template only form component specifically for user authentication for the UI. The component uses TokenSource which performs the necessary functionality all composed together using a StateChart to orchestrate the flow.

Errors are contained/rendered within the form itself.

hbs
<AuthForm
  @dc={{'dc-1'}}
  @partition={{'default'}}
  @nspace={{'default'}}
  @onsubmit={{noop}}
as |api|></AuthForm>

Arguments

ArgumentTypeDefaultDescription
dcStringThe name of the current datacenter
nspaceStringThe name of the current namespace
partitionStringThe name of the current partition
onsubmitFunctionThe action to fire when the form is submitted

Exported API

NameTypeDescription
submitFunctionSubmit the form with a {Name: 'oidc', Value: 'provider-name'} which will eventually be passed as the value to the TokenSource
focusFunctionFocus the input field
errorFunctionFire an error to be displayed in the form
resetFunctionReset the form back to its original empty/non-error state
disabledBooleanWhether the form is currently disabled or not

Slots

NameDescription
contentProvides a configurable slot underneath the form for addition of other login widgets, in our case SSO

See