804c804,807
<     if ($config->{POST_LOGIN_RUNMODE}) {
---
> 		if (my $destination = $cgiapp->query->param('destination')) {
>         $cgiapp->header_add(-location => $destination);
>         $cgiapp->prerun_mode('authen_dummy_redirect');
> 		} elsif ($config->{POST_LOGIN_RUNMODE}) {
809,811d811
<     } elsif (my $destination = $cgiapp->query->param('destination')) {
<         $cgiapp->header_add(-location => $destination);
<         $cgiapp->prerun_mode('authen_dummy_redirect');
978a979,1013
> =head2 errors
> 
> This will return whether or not the user has successfully logged in.
> 
> =cut
> 
> sub errors {
>     my $self = shift;
>     $self->initialize;
> 
>     my $e = $self->store->fetch('errors');
> 		$self->store->save('errors' => 0);
> 
>     return $e;
> }
> 
> =head2 destination
> 
> This will return the url of the page the user was at before the user was
> redirected to the login page.
> 
> =cut
> 
> sub destination {
>     my $self = shift;
>     $self->initialize;
> 
>     my $d = $self->store->fetch('destination');
> 		$self->store->save('destination' => '');
> 
>     return $d
> }
> 
> 
> 
1151d1185
< 
1189a1224,1225
>             $store->save( errors => 1 );
> 						return $self->redirect_to_login;
1211a1248
> 
1231c1268
<     my $destination = $query->param('destination') || $query->self_url;
---
>     my $destination = $self->destination;
1611a1649
> 					$authen->store->save('destination' => $self->query->self_url);
