aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/src/Endpoints/Internal/Root
diff options
context:
space:
mode:
authorivar <i@oiee.no>2024-04-28 22:37:48 +0200
committerivar <i@oiee.no>2024-04-28 22:37:48 +0200
commitf356f15d3a7dce1669944d23ab395ec96d042293 (patch)
tree03a82934ec802e2579daa45f748e959dc6598847 /code/api/src/Endpoints/Internal/Root
parentf99db65435f2cac81b5b48eb117991f4acd66a7e (diff)
downloadgreatoffice-f356f15d3a7dce1669944d23ab395ec96d042293.tar.xz
greatoffice-f356f15d3a7dce1669944d23ab395ec96d042293.zip
Misc
Diffstat (limited to 'code/api/src/Endpoints/Internal/Root')
-rw-r--r--code/api/src/Endpoints/Internal/Root/ValidateRoute.cs23
1 files changed, 10 insertions, 13 deletions
diff --git a/code/api/src/Endpoints/Internal/Root/ValidateRoute.cs b/code/api/src/Endpoints/Internal/Root/ValidateRoute.cs
index d8ec85a..f141fe9 100644
--- a/code/api/src/Endpoints/Internal/Root/ValidateRoute.cs
+++ b/code/api/src/Endpoints/Internal/Root/ValidateRoute.cs
@@ -6,8 +6,7 @@ public class ValidateRoute : RouteBaseSync.WithRequest<ValidateRoute.QueryParams
private readonly string CanonicalFrontendUrl;
private readonly ILogger<ValidateRoute> _logger;
- public ValidateRoute(EmailValidationService emailValidation, ILogger<ValidateRoute> logger)
- {
+ public ValidateRoute(EmailValidationService emailValidation, ILogger<ValidateRoute> logger) {
_emailValidation = emailValidation;
_logger = logger;
CanonicalFrontendUrl = Program.AppConfiguration.CANONICAL_FRONTEND_URL;
@@ -20,20 +19,18 @@ public class ValidateRoute : RouteBaseSync.WithRequest<ValidateRoute.QueryParams
}
[HttpGet("~/_/validate")]
- public override ActionResult Handle([FromQuery] QueryParams request)
- {
+ public override ActionResult Handle([FromQuery] QueryParams request) {
var isFulfilled = _emailValidation.FulfillEmailValidationRequest(request.Id, LoggedInUser.Id);
- if (!isFulfilled)
- {
+ if (!isFulfilled) {
_logger.LogError("Email validation fulfillment failed for request {requestId} and user {userId}", request.Id, LoggedInUser.Id);
return StatusCode(400, $"""
-<html>
-<body>
-<h3>The validation could not be completed</h3>
-<p>We are working on fixing this, in the meantime, have patience.</p>
-<a href="{CanonicalFrontendUrl}">Click here to go back to {CanonicalFrontendUrl}</a>
-</body>
-""");
+ <html>
+ <body>
+ <h3>The validation could not be completed</h3>
+ <p>We are working on fixing this, in the meantime, have patience.</p>
+ <a href="{CanonicalFrontendUrl}">Click here to go back to {CanonicalFrontendUrl}</a>
+ </body>
+ """);
}
return Redirect(CanonicalFrontendUrl + "/portal?msg=emailValidated");