aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/src/Endpoints/Internal/Root/ValidateRoute.cs
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-12-11 20:46:58 +0100
committerivarlovlie <git@ivarlovlie.no>2022-12-11 20:47:06 +0100
commit6561771c435f9d9bed1589b5ed13d17aee0b7873 (patch)
tree2c47e60fa4aaaa5bf1e151838ac197a61f4377cc /code/api/src/Endpoints/Internal/Root/ValidateRoute.cs
parent8da37c77cae0c7f712a775e3996afd9d84b0f9af (diff)
downloadgreatoffice-6561771c435f9d9bed1589b5ed13d17aee0b7873.tar.xz
greatoffice-6561771c435f9d9bed1589b5ed13d17aee0b7873.zip
feat: Add frontpage
Diffstat (limited to 'code/api/src/Endpoints/Internal/Root/ValidateRoute.cs')
-rw-r--r--code/api/src/Endpoints/Internal/Root/ValidateRoute.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/code/api/src/Endpoints/Internal/Root/ValidateRoute.cs b/code/api/src/Endpoints/Internal/Root/ValidateRoute.cs
new file mode 100644
index 0000000..682a869
--- /dev/null
+++ b/code/api/src/Endpoints/Internal/Root/ValidateRoute.cs
@@ -0,0 +1,25 @@
+namespace IOL.GreatOffice.Api.Endpoints.Internal.Root;
+
+public class ValidateRoute : RouteBaseSync.WithRequest<ValidateRoute.QueryParams>.WithActionResult
+{
+ private readonly UserService _userService;
+ private readonly string _continueTo;
+
+ public ValidateRoute(UserService userService, VaultService vaultService) {
+ _userService = userService;
+ var c = vaultService.GetCurrentAppConfiguration();
+ _continueTo = c.CANONICAL_FRONTEND_URL + "/?act=email-validated";
+ }
+
+ public class QueryParams
+ {
+ [FromQuery]
+ public Guid Id { get; set; }
+ }
+
+ [HttpGet("~/_/validate")]
+ public override ActionResult Handle([FromQuery] QueryParams request) {
+ _userService.FulfillEmailValidationRequest(request.Id, LoggedInUser.Id);
+ return Redirect(_continueTo);
+ }
+} \ No newline at end of file