I created a new Blazor project with individual accounts, then transferred the files over to the existing project. Then renamed ApplicationDbContext to: IdentityContext to distinguish from the application context. Then ran the update database command with the existing migration for identity.
14 lines
219 B
Plaintext
14 lines
219 B
Plaintext
@page "/auth"
|
|
|
|
@using Microsoft.AspNetCore.Authorization
|
|
|
|
@attribute [Authorize]
|
|
|
|
<PageTitle>Auth</PageTitle>
|
|
|
|
<h1>You are authenticated</h1>
|
|
|
|
<AuthorizeView>
|
|
Hello @context.User.Identity?.Name!
|
|
</AuthorizeView>
|