fix(user): include role when getting user by email

This commit is contained in:
ShiYu
2025-05-20 19:06:34 +08:00
parent 85dc34f6ea
commit 2c73fc29df

View File

@@ -106,7 +106,7 @@ public class UserService(IDbContextFactory<MyDbContext> dbContextFactory, IConfi
await using var context = await dbContextFactory.CreateDbContextAsync();
var user = await context.Users.FirstOrDefaultAsync(u => u.Email == email);
var user = await context.Users.Include(x => x.Role).FirstOrDefaultAsync(u => u.Email == email);
if (user == null)
{