diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-07-07 21:41:03 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-07-07 21:41:03 -0400 |
| commit | c02e917f5657db4bd76fc6ca17c535fc441c641c (patch) | |
| tree | b09ae21bd9c5f15cc9594eba27f5c982919c1872 /MediaBrowser.Api/SessionsService.cs | |
| parent | 379fa002288032097ff3222c7484136f10ab69d2 (diff) | |
completed auth database
Diffstat (limited to 'MediaBrowser.Api/SessionsService.cs')
| -rw-r--r-- | MediaBrowser.Api/SessionsService.cs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/MediaBrowser.Api/SessionsService.cs b/MediaBrowser.Api/SessionsService.cs index f4651601b..ed7db626f 100644 --- a/MediaBrowser.Api/SessionsService.cs +++ b/MediaBrowser.Api/SessionsService.cs @@ -213,6 +213,7 @@ namespace MediaBrowser.Api } [Route("/Sessions/Capabilities", "POST", Summary = "Updates capabilities for a device")] + [Authenticated] public class PostCapabilities : IReturnVoid { /// <summary> @@ -235,6 +236,11 @@ namespace MediaBrowser.Api public bool SupportsMediaControl { get; set; } } + [Route("/Sessions/Logout", "POST", Summary = "Reports that a session has ended")] + public class ReportSessionEnded : IReturnVoid + { + } + /// <summary> /// Class SessionsService /// </summary> @@ -246,16 +252,26 @@ namespace MediaBrowser.Api private readonly ISessionManager _sessionManager; private readonly IUserManager _userManager; + private readonly IAuthorizationContext _authContext; /// <summary> /// Initializes a new instance of the <see cref="SessionsService" /> class. /// </summary> /// <param name="sessionManager">The session manager.</param> /// <param name="userManager">The user manager.</param> - public SessionsService(ISessionManager sessionManager, IUserManager userManager) + public SessionsService(ISessionManager sessionManager, IUserManager userManager, IAuthorizationContext authContext) { _sessionManager = sessionManager; _userManager = userManager; + _authContext = authContext; + } + + + public void Post(ReportSessionEnded request) + { + var auth = _authContext.GetAuthorizationInfo(Request); + + _sessionManager.Logout(auth.Token); } /// <summary> |
