public static void RemoveAuthenticationFor(Auth0User auth0User, ISession session) { var userId = auth0User.Claims.Get(_config.UserIdentifier); if (session.ToList().Any(x => x.Key.Equals(_config.CookieName))) { session.Delete(_config.CookieName); } _users.Remove(userId); }
public static void CreateAuthenticationSessionFor(Auth0User auth0User, ISession session) { var userId = auth0User.Claims.Get(_config.UserIdentifier); session[_config.CookieName] = userId; if (_users.ContainsKey(userId)) { return; } _users.Add(userId, auth0User); }