feat: added auth for telegram stage
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Grpc.Core;
|
||||
using JOBot.Backend.DAL.Context;
|
||||
using JOBot.Backend.DAL.Models;
|
||||
@@ -7,7 +8,7 @@ using User = JOBot.Backend.DAL.Models.User;
|
||||
|
||||
namespace JOBot.Backend.Services.gRPC;
|
||||
|
||||
public class UserService(AppDbContext dbContext) : Proto.User.UserBase
|
||||
public class UserService(AppDbContext dbContext, HeadHunterService hhService) : Proto.User.UserBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Create user
|
||||
@@ -62,6 +63,16 @@ public class UserService(AppDbContext dbContext) : Proto.User.UserBase
|
||||
return new AcceptEulaResponse { Success = true };
|
||||
}
|
||||
|
||||
public override Task<GetHeadHunterAuthHookResponse> GetHeadHunterAuthHook(
|
||||
GetHeadHunterAuthHookRequest request,
|
||||
ServerCallContext context)
|
||||
{
|
||||
return Task.Run(() => new GetHeadHunterAuthHookResponse
|
||||
{
|
||||
RegistrationUrl = hhService.GenerateAuthLink(request.UserId)
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Throw RPCException if user not found
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user