Posts

Showing posts with the label redirect

Redirect to original preview URL after login through sitecore

I saw a question recently on Stackoverflow asking about when you send a preview link to the next person in workflow for approval, assuming that person is not logged in into sitecore yet, the preview link will redirect to sitecore login page, and after logining in, sitecore will forget about the orginal preview URL and go directly into sitecore desktop/Content editor. So, after looking into how sitecore login pipeline works, i found this solution: In your web.config, se t Authentication.SaveRawUrl to true, this will make the original requested URL passed to login page in a query string 'url'  Create class called " LoginRedirect ":  using System.Web; using Sitecore.Pipelines.LoggedIn; using Sitecore.Web; namespace Sitecore.SharedResources.Pipelines.Login { public class LoginRedirect : LoggedInProcessor { public override void Process(LoggedInArgs args) { if (Sitecore.Context.GetSiteName() != "login") { return; } string url = Htt...