mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
New: Forms authentication
This commit is contained in:
parent
7c38fcb9f3
commit
3c756348eb
35 changed files with 707 additions and 81 deletions
31
src/NzbDrone.Core/Authentication/UserRepository.cs
Normal file
31
src/NzbDrone.Core/Authentication/UserRepository.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
|
||||
namespace NzbDrone.Core.Authentication
|
||||
{
|
||||
public interface IUserRepository : IBasicRepository<User>
|
||||
{
|
||||
User FindUser(string username);
|
||||
User FindUser(Guid identifier);
|
||||
}
|
||||
|
||||
public class UserRepository : BasicRepository<User>, IUserRepository
|
||||
{
|
||||
public UserRepository(IDatabase database, IEventAggregator eventAggregator)
|
||||
: base(database, eventAggregator)
|
||||
{
|
||||
}
|
||||
|
||||
public User FindUser(string username)
|
||||
{
|
||||
return Query.Where(u => u.Username == username).SingleOrDefault();
|
||||
}
|
||||
|
||||
public User FindUser(Guid identifier)
|
||||
{
|
||||
return Query.Where(u => u.Identifier == identifier).SingleOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue