mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Implement user session management and JWT refresh tokens
Added user session models, interfaces, repository, and service for managing user sessions and refresh tokens. Refactored authentication flow to return user objects and open sessions with device info, supporting refresh token generation and validation. Updated JWT configuration to separate access and refresh options, and refactored related tests and API contracts. Improved media upload handling and error logging. Migrated dependency references and DI registrations accordingly.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using Govor.Core.Models;
|
||||
using Govor.Core.Models.Messages;
|
||||
using Govor.Core.Models.Users;
|
||||
@@ -10,6 +9,7 @@ namespace Govor.Data;
|
||||
public class GovorDbContext(DbContextOptions<GovorDbContext> options) : DbContext(options)
|
||||
{
|
||||
public virtual DbSet<User> Users { get; set; }
|
||||
public virtual DbSet<UserSession> UserSessions { get; set; }
|
||||
public virtual DbSet<Friendship> Friendships { get; set; }
|
||||
public virtual DbSet<PrivateChat> PrivateChats { get; set; }
|
||||
public virtual DbSet<Admin> Admins { get; set; }
|
||||
@@ -29,6 +29,7 @@ public class GovorDbContext(DbContextOptions<GovorDbContext> options) : DbContex
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.ApplyConfiguration(new UserSessionConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new FriendshipConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new UserConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new InvitationConfiguration());
|
||||
|
||||
Reference in New Issue
Block a user