1
0
mirror of https://github.com/bitwarden/server synced 2026-01-04 09:33:40 +00:00

More CanAccessPremium checks

This commit is contained in:
Kyle Spearrin
2018-08-28 17:40:08 -04:00
parent c41a1e0936
commit cf73b168ee
16 changed files with 90 additions and 48 deletions

View File

@@ -49,7 +49,7 @@ namespace Bit.Core.Identity
public async Task<string> GenerateAsync(string purpose, UserManager<User> manager, User user)
{
if(!user.Premium)
if(!(await _userService.CanAccessPremium(user)))
{
return null;
}
@@ -108,7 +108,7 @@ namespace Bit.Core.Identity
public async Task<bool> ValidateAsync(string purpose, string token, UserManager<User> manager, User user)
{
if(!user.Premium || string.IsNullOrWhiteSpace(token))
if(!(await _userService.CanAccessPremium(user)) || string.IsNullOrWhiteSpace(token))
{
return false;
}