Created
October 27, 2012 15:02
-
-
Save CoreyKaylor/3965008 to your computer and use it in GitHub Desktop.
Creating a diversion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AcceptPrivacyPolicyRedirector | |
{ | |
private readonly ISession _session; | |
public AcceptPrivacyPolicyRedirector(ISession session) | |
{ | |
_session = session; | |
} | |
public FubuContinuation Execute(UserRequestInputModel input) | |
{ | |
var userAccount = _session.Get<UserAccount>(input.UserName); | |
if(userAccount.HasAcceptedPrivacyPolicy) | |
{ | |
return FubuContinuation.NextBehavior(); | |
} | |
return FubuContinuation.RedirectTo(new AcceptPrivacyPolicyInputModel()); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AcceptPrivacyStatementPolicy : IConfigurationAction | |
{ | |
public void Configure(BehaviorGraph graph) | |
{ | |
graph.Actions() | |
.Where(x => x.RequiresAuthentication()) | |
.Each(x => x.AddBefore(ActionCall.For<AccceptPrivacyPolicyRedirector>())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment