updated application to check for contextual permissions

This commit is contained in:
2024-12-21 16:55:20 +01:00
parent ba46147a74
commit 59c452ff73
13 changed files with 58 additions and 21 deletions

View File

@@ -39,6 +39,11 @@ internal sealed class TokenRepository<TDbContext>(TDbContext context) : ITokenRe
await context.SaveChangesAsync();
}
public async Task DeleteToken(Token token) {
context.Tokens.Remove(token);
await context.SaveChangesAsync();
}
public async Task<Token> CreateApiToken(User owner, DateTime expirationDate) {
var token = new Token {
CreatedAt = expirationDate,