Single-session login policy + fix deck editor card search
Auth (single-session policy): - AuthGrpcHandler.Login now calls RevokeAllSessionsForUserAsync before CreateSessionAsync. When a user logs in on a new device, all existing sessions are revoked in Redis (token keys deleted) and marked RevokedAt in Postgres. The old device will fail auth.hello on its next reconnect and return to the login screen automatically. Admin (PrebuiltDeckEditor): - SearchCardsAsync and SearchArchSpiritsAsync were using .Contains() which compiles to a case-sensitive PostgreSQL LIKE. Changed to EF.Functions.ILike so card names can be found regardless of capitalisation. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -294,8 +294,9 @@ else
|
||||
private async Task SearchCardsAsync()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(_cardSearch)) return;
|
||||
var term = _cardSearch.Trim();
|
||||
_cardResults = await CatalogDb.CardDefinitions
|
||||
.Where(c => c.Name.Contains(_cardSearch))
|
||||
.Where(c => EF.Functions.ILike(c.Name, $"%{term}%"))
|
||||
.OrderBy(c => c.Name)
|
||||
.Take(10)
|
||||
.ToListAsync();
|
||||
@@ -304,8 +305,9 @@ else
|
||||
private async Task SearchArchSpiritsAsync()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(_archSearch)) return;
|
||||
var term = _archSearch.Trim();
|
||||
_archResults = await CatalogDb.CardDefinitions
|
||||
.Where(c => c.CardType == CardType.ArchSpirit && c.Name.Contains(_archSearch))
|
||||
.Where(c => c.CardType == CardType.ArchSpirit && EF.Functions.ILike(c.Name, $"%{term}%"))
|
||||
.OrderBy(c => c.Name)
|
||||
.Take(10)
|
||||
.ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user