From a1185b8194e0a2bcea77a509179ec2b37ffea002 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 30 Apr 2017 11:34:16 -0400 Subject: getting and setting of Codepoints --- Project-Unite/ACL.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Project-Unite/ACL.cs') diff --git a/Project-Unite/ACL.cs b/Project-Unite/ACL.cs index 6764a20..cc1c511 100644 --- a/Project-Unite/ACL.cs +++ b/Project-Unite/ACL.cs @@ -23,6 +23,15 @@ namespace Project_Unite return hpr.Raw(usr.UnreadNotifications.ToString()); } + internal static ApplicationUser GetUserFromToken(string token) + { + var db = new ApplicationDbContext(); + var t = db.OAuthTokens.FirstOrDefault(x => x.Id == token); + if (t == null) + return null; + return db.Users.FirstOrDefault(x => x.Id == t.UserId); + } + public static IHtmlString NewestUser(this HtmlHelper hpr) { var db = new ApplicationDbContext(); -- cgit v1.2.3