Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 34 additions & 27 deletions ExpenseTracker/.idea/.idea.ExpenseTracker/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace ExpenseTracker.Application.Services;

internal sealed class CurrentUserService : ICurrentUserService

Check failure on line 7 in ExpenseTracker/ExpenseTracker.Application/Services/CurrentUserService.cs

View workflow job for this annotation

GitHub Actions / build

'CurrentUserService' does not implement interface member 'ICurrentUserService.GetCurrentUserId()'

Check failure on line 7 in ExpenseTracker/ExpenseTracker.Application/Services/CurrentUserService.cs

View workflow job for this annotation

GitHub Actions / build

'CurrentUserService' does not implement interface member 'ICurrentUserService.GetCurrentUserId()'
{
private readonly IHttpContextAccessor _contextAccessor;

Expand All @@ -12,21 +12,6 @@
{
_contextAccessor = contextAccessor ?? throw new ArgumentNullException(nameof(contextAccessor));
}

public Guid GetCurrentUserId()
{
var user = (_contextAccessor.HttpContext?.User)
?? throw new InvalidOperationException("Current context does not have user.");

var userId = user.FindFirst(ClaimTypes.NameIdentifier)?.Value;

if (!Guid.TryParse(userId, out Guid result))
{
throw new InvalidOperationException($"Could not parse user id: {userId}.");
}

return result;
}

public string GetCurrentUserName()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ public class EmailOptions
public required string From { get; init; }

[Required(ErrorMessage = "Smtp server is required")]
ces
fcesc
es
cesc
es
ce
sdc
esd
class sd
cd
scds
cd
sc
public required string SmtpServer { get; init; }

[Required(ErrorMessage = "Port is required")]
Expand Down
Loading