diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-02-14 19:02:54 +0100 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-02-14 19:02:54 +0100 |
| commit | 1d482a4ec2cf24dbe7cc6cb02e192e1b9545f796 (patch) | |
| tree | 9b0a26b7d3efeecd5ec20a6e5624857624bc53a6 /src/server/Utilities/BasicAuthenticationHandler.cs | |
| parent | da4c22abbbf04566891976d01f5cf629857f8d0b (diff) | |
| download | bookmark-thing-1d482a4ec2cf24dbe7cc6cb02e192e1b9545f796.tar.xz bookmark-thing-1d482a4ec2cf24dbe7cc6cb02e192e1b9545f796.zip | |
feat: Experiment with tailwind
Diffstat (limited to 'src/server/Utilities/BasicAuthenticationHandler.cs')
| -rw-r--r-- | src/server/Utilities/BasicAuthenticationHandler.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/server/Utilities/BasicAuthenticationHandler.cs b/src/server/Utilities/BasicAuthenticationHandler.cs index c4124e8..fada122 100644 --- a/src/server/Utilities/BasicAuthenticationHandler.cs +++ b/src/server/Utilities/BasicAuthenticationHandler.cs @@ -60,19 +60,19 @@ public class BasicAuthenticationHandler : AuthenticationHandler<AuthenticationSc } var permissions = new List<Claim>() { - new(Constants.TOKEN_ALLOW_READ, token.AllowRead.ToString()), - new(Constants.TOKEN_ALLOW_UPDATE, token.AllowUpdate.ToString()), - new(Constants.TOKEN_ALLOW_CREATE, token.AllowCreate.ToString()), - new(Constants.TOKEN_ALLOW_DELETE, token.AllowDelete.ToString()), + new(AppConstants.TOKEN_ALLOW_READ, token.AllowRead.ToString()), + new(AppConstants.TOKEN_ALLOW_UPDATE, token.AllowUpdate.ToString()), + new(AppConstants.TOKEN_ALLOW_CREATE, token.AllowCreate.ToString()), + new(AppConstants.TOKEN_ALLOW_DELETE, token.AllowDelete.ToString()), }; var claims = token.User.DefaultClaims().Concat(permissions); - var identity = new ClaimsIdentity(claims, Constants.BASIC_AUTH_SCHEME); + var identity = new ClaimsIdentity(claims, AppConstants.BASIC_AUTH_SCHEME); var principal = new ClaimsPrincipal(identity); - var ticket = new AuthenticationTicket(principal, Constants.BASIC_AUTH_SCHEME); + var ticket = new AuthenticationTicket(principal, AppConstants.BASIC_AUTH_SCHEME); return Task.FromResult(AuthenticateResult.Success(ticket)); } catch (Exception e) { - _logger.LogError(e, $"An exception occured when challenging {Constants.BASIC_AUTH_SCHEME}"); + _logger.LogError(e, $"An exception occured when challenging {AppConstants.BASIC_AUTH_SCHEME}"); return Task.FromResult(AuthenticateResult.Fail("Invalid Authorization Header")); } } |
