As a new AC implementer my first site brought a couple of requirements that do not appear to be "in the box". In my site, the users cannot shop without logging in first. I couldn't find any posts describing exactly how this was accomplished by the community so I implemented a simple technique, although I had to insert a function in each page I needed to protect. I did this by inserting the following logic in pre_init on each page:
Code: Select all
protected void Page_PreInit(object sender, EventArgs e)
{
if (Token.Instance.User == null || Token.Instance.User.IsAnonymous)
Response.Redirect("~/Login.aspx");
}
This seems to work OK and using source control I can manage this simple difference when I upgrade later without a problem, but, since I am not an AC expert I'm wondering if there is something I overlooked or even a quicker/easier way to do this.
Regards,
Art