in the security assist login behavior, there is an options to Go to the Previous URL if it exists, it looks for an accesscehck url variable to determine the previous page.
make sure that option is enabled in the login behavior, and also make sure the login form action is set to forward any URL variables that are passed into it:
action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".htmlspecialchars($_SERVER["QUERY_STRING"]):""; ?>"