Skip to content

Commit

Permalink
Fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNikolic03 committed Jun 23, 2024
1 parent abc9003 commit b4d20cf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public async Task<IActionResult> IssueNewToken(string DsektToken){
if (isBlacklisted.HasValue){
return StatusCode(StatusCodes.Status403Forbidden, "You are not allowed to log in");
}
else if (isBlacklisted == null){
return BadRequest("Was not able to fetch if user is blacklisted");
}

IJwtRules jwtRules = new JwtRules(_config["Jwt:Issuer"],
_config["Jwt:Key"],
Expand Down
1 change: 0 additions & 1 deletion Backend/Meta-TV2-api/Meta-TV2-AccessLayer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
throw new SecurityException("No issuer or key was found in appsettings nor in the environment for generating JWT");
}


builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
Expand Down
9 changes: 8 additions & 1 deletion Backend/Meta-TV2-api/Meta-TV2-BusinessLayer/BusinessRules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ public class BusinessRules : IBusinessRules
IDataAccess dataAccess = new DataAccess();

public async Task<Optional<Blacklist>> GetBlacklistByAlias(string alias){
return await dataAccess.GetBlacklistByAlias(alias);
try
{
return await dataAccess.GetBlacklistByAlias(alias);
}
catch (Exception e)
{
return null;
}
}

public bool BanUser(string alias){
Expand Down

0 comments on commit b4d20cf

Please sign in to comment.