@@ -90,7 +90,7 @@ namespace Teknik.IdentityServer.Configuration | |||
Name = config.UserConfig.IdentityServerConfig.APIName, | |||
DisplayName = "Teknik API", | |||
Description = "Teknik API Access for end users", | |||
UserClaims = new List<string> {"role"}, | |||
UserClaims = new List<string> {"role", "username"}, | |||
ApiSecrets = new List<Secret> {new Secret(config.UserConfig.IdentityServerConfig.APISecret.Sha256()) }, | |||
Scopes = new List<Scope> { | |||
new Scope("teknik-api.read", "Teknik API Read Access"), |
@@ -41,13 +41,10 @@ namespace Teknik.Areas.API.V1.Controllers | |||
if (User.Identity.IsAuthenticated) | |||
{ | |||
maxUploadSize = _config.UploadConfig.MaxUploadSizeBasic; | |||
if (User.Identity.IsAuthenticated) | |||
IdentityUserInfo userInfo = await IdentityHelper.GetIdentityUserInfo(_config, User.Identity.Name); | |||
if (userInfo.AccountType == AccountType.Premium) | |||
{ | |||
IdentityUserInfo userInfo = await IdentityHelper.GetIdentityUserInfo(_config, User.Identity.Name); | |||
if (userInfo.AccountType == AccountType.Premium) | |||
{ | |||
maxUploadSize = _config.UploadConfig.MaxUploadSizePremium; | |||
} | |||
maxUploadSize = _config.UploadConfig.MaxUploadSizePremium; | |||
} | |||
} | |||
if (model.file.Length <= maxUploadSize) |
@@ -66,13 +66,10 @@ namespace Teknik.Areas.Upload.Controllers | |||
if (User.Identity.IsAuthenticated) | |||
{ | |||
maxUploadSize = _config.UploadConfig.MaxUploadSizeBasic; | |||
if (User.Identity.IsAuthenticated) | |||
IdentityUserInfo userInfo = await IdentityHelper.GetIdentityUserInfo(_config, User.Identity.Name); | |||
if (userInfo.AccountType == AccountType.Premium) | |||
{ | |||
IdentityUserInfo userInfo = await IdentityHelper.GetIdentityUserInfo(_config, User.Identity.Name); | |||
if (userInfo.AccountType == AccountType.Premium) | |||
{ | |||
maxUploadSize = _config.UploadConfig.MaxUploadSizePremium; | |||
} | |||
maxUploadSize = _config.UploadConfig.MaxUploadSizePremium; | |||
} | |||
} | |||
if (uploadFile.file.Length <= maxUploadSize) |