mirror of
https://github.com/GCMatters/hermes.git
synced 2026-02-04 21:50:12 +01:00
feat: secure existing events endpoints by validating the token cookie
This commit is contained in:
@@ -25,7 +25,7 @@ public class GeneralUseHelpers
|
||||
{
|
||||
// Zwróci null, gdy nie znaleziono użytkownika
|
||||
if (t is null) return null;
|
||||
User? user = await _context.WebUsers.FindAsync(t.Value);
|
||||
User? user = await _context.WebUsers.FindAsync(t.UserId);
|
||||
|
||||
return user;
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public class GeneralUseHelpers
|
||||
User? user = await GetUserFromToken(t);
|
||||
if (user is not null && user.IsOrganisation)
|
||||
{
|
||||
Organisation? org = await _context.Organisations.FindAsync(t.UserId);
|
||||
Organisation? org = await _context.Organisations.FirstOrDefaultAsync(o => o.UserId == t.UserId);
|
||||
|
||||
if (org is null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user