From cc6fcb775c0eb99eb736e3aa868feeb0cd4f2803 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Fri, 1 Dec 2017 14:16:02 +0100 Subject: [PATCH] Added deeplinks to Open Ledgers --- Site/Security/Login.aspx.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Site/Security/Login.aspx.cs b/Site/Security/Login.aspx.cs index d4b5f6a3..75d0141a 100644 --- a/Site/Security/Login.aspx.cs +++ b/Site/Security/Login.aspx.cs @@ -93,7 +93,14 @@ namespace Swarmops.Pages.Security { DashboardMessage.Set (String.Format(Resources.Pages.Security.Login_AsOpenLedgers, organizationOpenLedgers.Name)); FormsAuthentication.SetAuthCookie(Authority.FromLogin (Person.FromIdentity (Person.OpenLedgersIdentity), organizationOpenLedgers).ToEncryptedXml(), true); - Response.Redirect (@"/Ledgers/Balance"); + if (HttpContext.Current.Request["ReturnUrl"] == "/") + { + Response.Redirect(@"/Ledgers/Balance"); + } + else + { + Response.Redirect(HttpContext.Current.Request["ReturnUrl"]); // Returns to the requested URL with auth cookie set + } } // Check for SSL and force it