Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #6

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 14 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,14 @@ Inject the `IPasswordlessClient` into your component and call the `RegisterAsync
Your form could look like the one below.

```html
<div class="card h-100">
<div class="card-body">
<h5 class="card-title mb-2">Register</h5>
<EditForm FormName="@RegisterFormName" Model="@RegisterViewModel" OnValidSubmit="OnRegistrationAsync">
<DataAnnotationsValidator/>
<InputText class="form-control mb-2" DisplayName="Username" @bind-Value="RegisterViewModel.Username"
placeholder="Username"/>
<ValidationMessage class="mb-2 validation-message" For="@(() => RegisterViewModel.Username)"/>
<InputText class="form-control mb-2" DisplayName="Alias" @bind-Value="RegisterViewModel.Alias"
placeholder="Alias (optional)"/>
<ValidationMessage class="mb-2 validation-message" For="@(() => RegisterViewModel.Alias)"/>
<button class="btn btn-primary" type="submit">Register</button>
</EditForm>
</div>
</div>
<EditForm FormName="@RegisterFormName" Model="@RegisterViewModel" OnValidSubmit="OnRegistrationAsync">
<DataAnnotationsValidator/>
<InputText class="form-control" DisplayName="Username" @bind-Value="RegisterViewModel.Username" placeholder="Username"/>
<ValidationMessage class="validation-message" For="@(() => RegisterViewModel.Username)"/>
<InputText class="form-control" DisplayName="Alias" @bind-Value="RegisterViewModel.Alias" placeholder="Alias (optional)"/>
<ValidationMessage class="validation-message" For="@(() => RegisterViewModel.Alias)"/>
<button class="btn btn-primary" type="submit">Register</button>
</EditForm>
```

In the form submission event handlers, handle the registration.
Expand Down Expand Up @@ -89,17 +82,12 @@ Inject the `IPasswordlessClient` into your component and call the `RegisterAsync
Your form could look like the one below.

```html
<div class="card h-100">
<div class="card-body">
<h5 class="card-title mb-2">Login</h5>
<EditForm FormName="@LoginFormName" Model="@LoginViewModel" OnValidSubmit="OnSignInAsync">
<DataAnnotationsValidator />
<InputText class="form-control mb-2" DisplayName="Alias" @bind-Value="LoginViewModel.Alias" placeholder="Alias (optional)"/>
<ValidationMessage class="mb-2 validation-message" For="@(() => LoginViewModel.Alias)"/>
<button class="btn btn-primary" type="submit">Sign In</button>
</EditForm>
</div>
</div>
<EditForm FormName="@LoginFormName" Model="@LoginViewModel" OnValidSubmit="OnSignInAsync">
<DataAnnotationsValidator />
<InputText class="form-control" DisplayName="Alias" @bind-Value="LoginViewModel.Alias" placeholder="Alias (optional)"/>
<ValidationMessage class="validation-message" For="@(() => LoginViewModel.Alias)"/>
<button class="btn btn-primary" type="submit">Sign In</button>
</EditForm>
```

In the form submission event handlers, handle the login.
Expand Down
Loading