2
votes

I am having a small issue using the classic WebLogin snippet (Not WebLoginPE) in MODx.

Quick example of what's going on:

User logs in via page ID 3. Upon a successful log in, they are sent automatically to page ID 11.

Now currently, if the user visits page ID 3, they stay there, not being redirected (as they are not interacting with the actual login box anymore)

I would like this snippet (or page) to redirect as it does after the initial login process.

To fix this temporarily I have done a JS redirect placed in the WebLogin template but I am confident there is a smoother way (maybe something with MemberCheck?)

1
You really should tick this as answered so it will be able to help others. :)user328570

1 Answers

0
votes

Put this in a TV (Template Variable):

@EVAL if ($modx->getLoginUserID()) {
  $redirectPage = $modx->makeUrl(11);
  $modx->sendRedirect($redirectPage);
}
else {
  return "You are not authenticated!";
}