diff options
Diffstat (limited to 'Project-Unite/ACL.cs')
| -rw-r--r-- | Project-Unite/ACL.cs | 9 |
1 files changed, 9 insertions, 0 deletions
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(); |
