redirect after log-in

edited August 2015 in Bug Reports
If a user's session has expired, they are sent to the log-in. After they log in, I'd like to take them back to the page they were trying to access. What's the easiest way to do this? Is there something I can pass the login page to redirect back?

Comments

  • edited 9:34AM
    The fuel/modules/fuel/controllers/logout.php controller does this and it should be happening already.
  • edited August 2015
    I must be doing it wrong. In my code when I use a function to determine if the current user is authorized to view the current page. The first thing it does is the following:

    if (!$CI->fuel->auth->is_logged_in()) { return FALSE; } if ($CI->fuel->auth->is_super_admin()) { return TRUE; }

    Upon returning FALSE, the following is displayed:
    You are not authorized to view this project or you may need to <a href="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . '/navserver/fuel' ?>">Log In</a><br/>

    Is there a way I should be doing this differently?
  • edited 9:34AM
    I think I got it.
    $CI->fuel->admin->check_login();
    Added this and now it seems to work the way I want it to.
Sign In or Register to comment.