mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add ApplicationUser entity.
This commit is contained in:
6
Cicm.Database/Models/ApplicationUser.cs
Normal file
6
Cicm.Database/Models/ApplicationUser.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
using Microsoft.AspNetCore.Identity;
|
||||||
|
|
||||||
|
namespace Cicm.Database.Models
|
||||||
|
{
|
||||||
|
public class ApplicationUser : IdentityUser { }
|
||||||
|
}
|
||||||
@@ -31,7 +31,6 @@
|
|||||||
using Cicm.Database.Models;
|
using Cicm.Database.Models;
|
||||||
using cicm_web.Areas.Identity;
|
using cicm_web.Areas.Identity;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Identity;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
[assembly: HostingStartup(typeof(IdentityHostingStartup))]
|
[assembly: HostingStartup(typeof(IdentityHostingStartup))]
|
||||||
@@ -44,7 +43,7 @@ namespace cicm_web.Areas.Identity
|
|||||||
{
|
{
|
||||||
builder.ConfigureServices((context, services) =>
|
builder.ConfigureServices((context, services) =>
|
||||||
{
|
{
|
||||||
services.AddDefaultIdentity<IdentityUser>()
|
services.AddDefaultIdentity<ApplicationUser>()
|
||||||
.AddEntityFrameworkStores<cicmContext>();
|
.AddEntityFrameworkStores<cicmContext>();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
|
@using Cicm.Database.Models
|
||||||
@using Microsoft.AspNetCore.Identity
|
@using Microsoft.AspNetCore.Identity
|
||||||
@using Microsoft.Extensions.PlatformAbstractions
|
@using Microsoft.Extensions.PlatformAbstractions
|
||||||
@inject SignInManager<IdentityUser> SignInManager
|
@inject SignInManager<ApplicationUser> SignInManager
|
||||||
@inject UserManager<IdentityUser> UserManager
|
@inject UserManager<ApplicationUser> UserManager
|
||||||
@{
|
@{
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
// Canary Islands Computer Museum Website
|
// Canary Islands Computer Museum Website
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
@using Cicm.Database.Models
|
||||||
@using Microsoft.AspNetCore.Identity
|
@using Microsoft.AspNetCore.Identity
|
||||||
@inject SignInManager<IdentityUser> SignInManager
|
@inject SignInManager<ApplicationUser> SignInManager
|
||||||
@inject UserManager<IdentityUser> UserManager
|
@inject UserManager<ApplicationUser> UserManager
|
||||||
@{
|
@{
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
// Canary Islands Computer Museum Website
|
// Canary Islands Computer Museum Website
|
||||||
@@ -35,13 +36,26 @@
|
|||||||
|
|
||||||
@if(SignInManager.IsSignedIn(User))
|
@if(SignInManager.IsSignedIn(User))
|
||||||
{
|
{
|
||||||
<form asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/Index", new { area = "" })" method="post" id="logoutForm" class="navbar-right">
|
<form asp-area="Identity"
|
||||||
|
asp-page="/Account/Logout"
|
||||||
|
asp-route-returnUrl="@Url.Page("/Index", new {area = ""})"
|
||||||
|
method="post"
|
||||||
|
id="logoutForm"
|
||||||
|
class="navbar-right">
|
||||||
<ul class="ml-auto navbar-nav">
|
<ul class="ml-auto navbar-nav">
|
||||||
<li>
|
<li>
|
||||||
<a asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage" class=nav-link>Hello @UserManager.GetUserName(User)!</a>
|
<a asp-area="Identity"
|
||||||
|
asp-page="/Account/Manage/Index"
|
||||||
|
class=nav-link
|
||||||
|
title="Manage">
|
||||||
|
Hello @UserManager.GetUserName(User)!
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button type="submit" class="btn btn-link nav-link">Logout</button>
|
<button class="btn btn-link nav-link"
|
||||||
|
type="submit">
|
||||||
|
Logout
|
||||||
|
</button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
@@ -61,8 +75,16 @@ else
|
|||||||
</a>
|
</a>
|
||||||
<div aria-labelledby=accountDropdown
|
<div aria-labelledby=accountDropdown
|
||||||
class=dropdown-menu>
|
class=dropdown-menu>
|
||||||
<a asp-area="Identity" asp-page="/Account/Register" class=dropdown-item>Register</a>
|
<a asp-area="Identity"
|
||||||
<a asp-area="Identity" asp-page="/Account/Login" class=dropdown-item>Login</a>
|
asp-page="/Account/Register"
|
||||||
|
class=dropdown-item>
|
||||||
|
Register
|
||||||
|
</a>
|
||||||
|
<a asp-area="Identity"
|
||||||
|
asp-page="/Account/Login"
|
||||||
|
class=dropdown-item>
|
||||||
|
Login
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user