feat: added auth hook using RabbitMQ on client for login continue
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
namespace JOBot.Backend.Infrastructure.Config;
|
||||
|
||||
public static class RabbitQueues
|
||||
{
|
||||
public const string AuthQueue = "auth";
|
||||
}
|
||||
@@ -31,4 +31,8 @@
|
||||
<Folder Include="Data\Migrations\"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\JOBot.Infrastructure\JOBot.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -3,6 +3,7 @@ using System.Text.Json;
|
||||
using JOBot.Backend.DAL.Context;
|
||||
using JOBot.Backend.DTOs.HeadHunterHook;
|
||||
using JOBot.Backend.Infrastructure.Config;
|
||||
using JOBot.Infrastructure.Config;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Options;
|
||||
using RabbitMQ.Client;
|
||||
|
||||
@@ -2,6 +2,7 @@ using JOBot.Backend.DAL.Context;
|
||||
using JOBot.Backend.Infrastructure.Config;
|
||||
using JOBot.Backend.Services;
|
||||
using JOBot.Backend.Services.gRPC;
|
||||
using JOBot.Infrastructure.Config;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using RabbitMQ.Client;
|
||||
|
||||
@@ -22,8 +23,13 @@ public class Startup(IConfiguration configuration)
|
||||
{
|
||||
HostName = "jobot-rabbitmq"
|
||||
}.CreateConnectionAsync();
|
||||
await using var channel = await rabbitMqConnection.CreateChannelAsync();
|
||||
await channel.QueueDeclareAsync(RabbitQueues.AuthQueue, false, false, false);
|
||||
var channel = await rabbitMqConnection.CreateChannelAsync();
|
||||
await channel.QueueDeclareAsync(
|
||||
RabbitQueues.AuthQueue,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
arguments: null);
|
||||
services.AddSingleton(channel);
|
||||
|
||||
services.AddDbContext<AppDbContext>(options =>
|
||||
|
||||
Reference in New Issue
Block a user