Skip to content

Commit

Permalink
config
Browse files Browse the repository at this point in the history
  • Loading branch information
handesirikci0rso committed Apr 10, 2024
1 parent 66fdf29 commit 885383e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ public async Task RevokeRefreshTokenAsync(string refreshToken, string remoteIpAd
public async Task SignOut(string refreshToken, string remoteIpAddress)
{
await RevokeRefreshTokenAsync(refreshToken, remoteIpAddress);
await _cookieSignIn.SignOutUser();
var command = new SignOutUser.Command { };
await _mediator.Send(command);
}
}
}
35 changes: 35 additions & 0 deletions Orso.Arpa.Domain/UserDomain/Commands/SignOutUser.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Threading;
using System.Threading.Tasks;
using MediatR;
using Orso.Arpa.Domain.General.Interfaces;

namespace Orso.Arpa.Domain.UserDomain.Commands
{
public class SignOutUser
{
public class Command : IRequest<bool>
{
}

public class Handler : IRequestHandler<Command, bool>
{
private readonly ICookieSignIn _cookieSignIn;


public Handler(
ICookieSignIn cookieSignInService)
{
_cookieSignIn = cookieSignInService;
}

public async Task<bool> Handle(Command request, CancellationToken cancellationToken)
{
Task signOutTask = _cookieSignIn.SignOutUser();
await signOutTask;

return signOutTask.IsCompletedSuccessfully;
}

}
}
}

0 comments on commit 885383e

Please sign in to comment.