mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-07 21:51:13 -07:00
Updated the claims so we can support more users.
Added a user management section (not yet complete) Added the api to the solution and a api key in the settings (currently only gets the requests).
This commit is contained in:
parent
741a4ae75c
commit
98eadc9cc6
12 changed files with 217 additions and 1 deletions
|
@ -172,6 +172,8 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
Get["/headphones"] = _ => Headphones();
|
||||
Post["/headphones"] = _ => SaveHeadphones();
|
||||
|
||||
Post ["/createapikey"] = x => CreateApiKey ();
|
||||
}
|
||||
|
||||
private Negotiator Authentication()
|
||||
|
@ -705,5 +707,20 @@ namespace PlexRequests.UI.Modules
|
|||
? new JsonResponseModel { Result = true, Message = "Successfully Updated the Settings for Headphones!" }
|
||||
: new JsonResponseModel { Result = false, Message = "Could not update the settings, take a look at the logs." });
|
||||
}
|
||||
|
||||
private Response CreateApiKey()
|
||||
{
|
||||
this.RequiresClaims (UserClaims.Admin);
|
||||
|
||||
var apiKey = Guid.NewGuid ().ToString ("N");
|
||||
|
||||
var settings = PrService.GetSettings ();
|
||||
|
||||
settings.ApiKey = apiKey;
|
||||
|
||||
PrService.SaveSettings (settings);
|
||||
|
||||
return Response.AsJson (apiKey);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue