Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Nancy;
- using Nancy.Authentication.Forms;
- using Nancy.Security;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Authentication
- {
- public class DatabaseUser : IUserMapper
- {
- public IUserIdentity GetUserFromIdentifier(Guid identifier, NancyContext context)
- {
- using (var db = new UserContext())
- {
- var member = db.Users.SingleOrDefault(u => u.Identifier == identifier);
- if (member == null)
- {
- return null;
- }
- return member;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement