-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49ccadd
commit 94d281b
Showing
7 changed files
with
407 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,11 +24,6 @@ | |
<DataAnnotationsValidator /> | ||
<h2>Opret en ny konto.</h2> | ||
<hr /> | ||
<div class="form-floating mb-3"> | ||
<InputText @bind-Value="Input.Username" class="form-control" autocomplete="username" aria-required="true" placeholder=""/> | ||
<label for="username">Brugernavn</label> | ||
<ValidationMessage For="() => Input.Username" class="text-danger" /> | ||
</div> | ||
<div class="form-floating mb-3"> | ||
<InputText @bind-Value="Input.Email" class="form-control" autocomplete="email" aria-required="true" placeholder="[email protected]" /> | ||
<label for="email">Email</label> | ||
|
@@ -87,7 +82,7 @@ | |
|
||
var userId = await UserManager.GetUserIdAsync(user); | ||
|
||
var userProfile = new UserProfile { Id = user.Id, UserName = Input.Username }; | ||
var userProfile = new UserProfile { Id = user.Id }; | ||
await using var context = await DbContextFactory.CreateDbContextAsync(); | ||
context.UserProfiles.Add(userProfile); | ||
await context.SaveChangesAsync(); | ||
|
@@ -135,13 +130,6 @@ | |
|
||
private sealed class InputModel | ||
{ | ||
[Required(ErrorMessage = "Påkrævet.")] | ||
[StringLength(30, MinimumLength = 2, ErrorMessage = "{0] skal være mellem {2} og {1} karakter langt.")] | ||
[RegularExpression("^[\\w@-_\\.^][^\\\\]+$", | ||
ErrorMessage = "Brugernavn må kun bestå af bogstaver, tal, og udvalgte tegn.")] | ||
[Display(Name = "Brugernavn")] | ||
public string Username { get; set; } = ""; | ||
|
||
[Required(ErrorMessage = "Påkrævet.")] | ||
[EmailAddress(ErrorMessage = "Email skal være gyldig.")] | ||
[Display(Name = "Email")] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.