Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Shared.Logger;
using SimpleResults;

namespace IdentityServerHost.Pages.EmailConfirmation;
Expand Down Expand Up @@ -53,7 +54,8 @@ public async Task<IActionResult> OnGet(CancellationToken cancellationToken) {
// Send the welcome email
SecurityServiceCommands.SendWelcomeEmailCommand command = new(Input.Username);
Result? sendWelcomeEmailResult = await this.Mediator.Send(command, cancellationToken);
// TODO: handle this result....
if (sendWelcomeEmailResult.IsFailed)
Logger.LogWarning($"Error sending welcome email to {this.Input.Username} [{sendWelcomeEmailResult.Message}]");

}
return Page();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,21 @@ public async Task<IActionResult> OnPost(CancellationToken cancellationToken)
return Redirect("Login/Index");
}

// TODO: Check passwords match etc here

if (ModelState.IsValid) {
// process the password change
SecurityServiceCommands.ProcessPasswordResetConfirmationCommand command = new(Input.Username, Input.Token, Input.Password, Input.ClientId);
Result<String>? result= await this.Mediator.Send(command, cancellationToken);
// TODO: Failure case

if (result.IsFailed) {
this.View = new ViewModel
{
Username = Input.Username,
Token = Input.Token,
UserMessage = $"Failed processing password reset for username {Input.Username}: {result.Message}"
};
return Page();
}

return this.Redirect(result.Data);
}

Expand Down
1 change: 0 additions & 1 deletion SecurityService.UserInterface/Pages/Device/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
}


private async Task<ViewModel> BuildViewModelAsync(string userCode, InputModel model = null)

Check warning on line 137 in SecurityService.UserInterface/Pages/Device/Index.cshtml.cs

View workflow job for this annotation

GitHub Actions / Build and Unit Test Pull Requests - Firefox UI

Cannot convert null literal to non-nullable reference type.
{
var request = await _interaction.GetAuthorizationContextAsync(userCode);
if (request != null)
Expand Down Expand Up @@ -194,7 +194,6 @@
return new ScopeViewModel
{
Value = parsedScopeValue.RawValue,
// todo: use the parsed scope value in the display?
DisplayName = apiScope.DisplayName ?? apiScope.Name,
Description = apiScope.Description,
Emphasize = apiScope.Emphasize,
Expand Down
3 changes: 2 additions & 1 deletion SecurityService/Common/SwaggerJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public override Object ReadJson(JsonReader reader,
Object existingValue,
JsonSerializer serializer)
{
throw new NotImplementedException();
// Not used because CanRead returns false
return new Object();
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion SecurityService/Controllers/ApiResourceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public async Task<IActionResult> CreateApiResource([FromBody] CreateApiResourceR
createApiResourceRequest.UserClaims);

Result result = await this.Mediator.Send(command, cancellationToken);
// TODO: Handle failed result

return result.ToActionResultX();
}

Expand Down
Loading