using Dapper;
using Galaeth.Core.Entities;
using Galaeth.Core.Infrastructure;
using Galaeth.Core.RepositoryInterfaces;
using Injectio.Attributes;
namespace Galaeth.DAL.Repositories;
///
[RegisterScoped]
public class RefreshTokenRepository : BaseRepository, IRefreshTokenRepository
{
///
/// Initializes a new instance of the class.
///
/// Instance of .
public RefreshTokenRepository(IDbConnectionProvider db)
: base(db)
{
}
///
public async Task RevokeAllForUser(Guid userId)
{
await WithDatabaseAsync(async connection => await connection.ExecuteAsync(
$"DELETE FROM {Table} WHERE userId = @pUserId", new
{
pUserId = userId,
}));
}
}