Skip to content

Instantly share code, notes, and snippets.

View maliming's full-sized avatar
🏠
Working from home

Ma Liming maliming

🏠
Working from home
View GitHub Profile
@maliming
maliming / AccountController.cs
Created May 8, 2017 00:56 — forked from hikalkan/AccountController.cs
Adding a new property to session
//Add new property to claims on login
private async Task SignInAsync(User user, ClaimsIdentity identity = null, bool rememberMe = false)
{
if (identity == null)
{
identity = await _userManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie);
}
identity.AddClaim(new Claim("Application_UserEmail", user.EmailAddress)); //SETTING NEW PROPERTY
using System;
using System.IO;
using System.Linq;
using System.Text;
namespace AbpWebSite.Templates
{
/// <summary>
/// Used to rename a solution
/// </summary>