aboutsummaryrefslogtreecommitdiffstats
path: root/src/Pages/LoggInn.cshtml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Pages/LoggInn.cshtml.cs')
-rw-r--r--src/Pages/LoggInn.cshtml.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Pages/LoggInn.cshtml.cs b/src/Pages/LoggInn.cshtml.cs
new file mode 100644
index 0000000..d4ee7d7
--- /dev/null
+++ b/src/Pages/LoggInn.cshtml.cs
@@ -0,0 +1,19 @@
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace VSH.Pages;
+
+public class LoggInn : PageModel
+{
+ public ActionResult OnGet() {
+ if (User.Identity?.IsAuthenticated ?? false) {
+ if (Request.Query.ContainsKey("ReturnUrl")) {
+ return Redirect(Request.Query["ReturnUrl"]);
+ }
+
+ return Redirect("/kontoret");
+ }
+
+ return Page();
+ }
+} \ No newline at end of file