public static JRSession Create(ApiToken token, JRUser user, string ip) { var session = new JRSession { UserId = user.Id, Created = DateTime.Now, LastRequest = DateTime.Now, SessionId = token.AuthtnicationToken, Ip = ip, Data = new Dictionary<string, object>() }; Sessions.Add(session); return session; }
public async Task<string> Register(string email, string password) { var user = new JRUser(email); var result = await UserManager.CreateAsync(user, password); if (result.Succeeded) { return "Success"; } else { foreach (var error in result.Errors) { return error; } return "Error"; } }