mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-08 14:10:50 -07:00
Set the admin to have all claims
This commit is contained in:
parent
a679f1a6a1
commit
16bd4f5b71
4 changed files with 87 additions and 20 deletions
|
@ -46,24 +46,24 @@ namespace PlexRequests.UI.Modules
|
|||
return Response.AsJson(users);
|
||||
}
|
||||
|
||||
private Response CreateUser(string username, string password, string claims)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(username) || string.IsNullOrWhiteSpace(password))
|
||||
{
|
||||
return Response.AsJson(new JsonResponseModel
|
||||
{
|
||||
Result = true,
|
||||
Message = "Please enter in a valid Username and Password"
|
||||
});
|
||||
}
|
||||
var user = UserMapper.CreateUser(username, password, new string[] {claims});
|
||||
if (user.HasValue)
|
||||
{
|
||||
return Response.AsJson(new JsonResponseModel {Result = true});
|
||||
}
|
||||
//private Response CreateUser(string username, string password, string claims)
|
||||
//{
|
||||
// if (string.IsNullOrWhiteSpace(username) || string.IsNullOrWhiteSpace(password))
|
||||
// {
|
||||
// return Response.AsJson(new JsonResponseModel
|
||||
// {
|
||||
// Result = true,
|
||||
// Message = "Please enter in a valid Username and Password"
|
||||
// });
|
||||
// }
|
||||
// var user = UserMapper.CreateUser(username, password, new string[] {claims});
|
||||
// if (user.HasValue)
|
||||
// {
|
||||
// return Response.AsJson(new JsonResponseModel {Result = true});
|
||||
// }
|
||||
|
||||
return Response.AsJson(new JsonResponseModel {Result = false, Message = "Could not save user"});
|
||||
}
|
||||
// return Response.AsJson(new JsonResponseModel {Result = false, Message = "Could not save user"});
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue