mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-08 10:44:20 -04:00
Clean up
This commit is contained in:
parent
7015f33c22
commit
ea3b320dad
@ -79,11 +79,6 @@ namespace Kyoo.Api
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly string _picturePath;
|
||||
|
||||
public Claim[] defaultClaims =
|
||||
{
|
||||
new Claim("permissions", "read,play") // TODO should add this field on the server's configuration page.
|
||||
};
|
||||
|
||||
public AccountController(UserManager<User> userManager, SignInManager<User> siginInManager, IConfiguration configuration)
|
||||
{
|
||||
_userManager = userManager;
|
||||
@ -109,7 +104,9 @@ namespace Kyoo.Api
|
||||
return BadRequest(result.Errors);
|
||||
string otac = account.GenerateOTAC(TimeSpan.FromMinutes(1));
|
||||
await _userManager.UpdateAsync(account);
|
||||
await _userManager.AddClaimsAsync(account, defaultClaims);
|
||||
await _userManager.AddClaimAsync(account, new Claim(
|
||||
"permissions",
|
||||
_configuration.GetValue<string>("newUserPermissions")));
|
||||
return Ok(new {otac});
|
||||
}
|
||||
|
||||
|
@ -27,5 +27,6 @@
|
||||
"profilePicturePath": "users/",
|
||||
"plugins": "plugins/",
|
||||
"defaultPermissions": "read,play,write,admin",
|
||||
"newUserPermissions": "read,play,write,admin",
|
||||
"regex": "(\\/(?<Collection>.*)\\/)?.*\\/(?<ShowTitle>.+?)(( S(?<Season>\\d+)E(?<Episode>\\d+)| (?<Absolute>\\d+)))?\\."
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user