Added the ability to get the apikey from the api if you provide a correct username and password.

Added more unit tests
Added the ability to change a users password using the api
refactored the Usermapper and made it unit testsable.

Also api documentation for the new endpoints too.

#222 #205
This commit is contained in:
tidusjar 2016-05-20 10:44:02 +01:00
parent 84dc4515fd
commit cbfe88cd6d
14 changed files with 424 additions and 44 deletions

View file

@ -41,8 +41,9 @@ namespace PlexRequests.UI.Modules
{
public class LoginModule : BaseModule
{
public LoginModule(ISettingsService<PlexRequestSettings> pr) : base(pr)
public LoginModule(ISettingsService<PlexRequestSettings> pr, ICustomUserMapper m) : base(pr)
{
UserMapper = m;
Get["/login"] = _ =>
{
{
@ -110,6 +111,7 @@ namespace PlexRequests.UI.Modules
Get["/changepassword"] = _ => ChangePassword();
Post["/changepassword"] = _ => ChangePasswordPost();
}
private ICustomUserMapper UserMapper { get; }
private Negotiator ChangePassword()
{