LPH
Well-known member
External login, link to the profile, etc seems to be working but the external logout link returns a message stating:
I'm thinking it is the $visitor array but maybe there is a better way to do this rather than the above code.
Update:
It's getting a container key app error.
But stuck on the same error.
Thank you for your help.
Security error occurred. Please press back, refresh the page, and try again.
Code:
<?php echo '<a class="xenword_logout logout" href="' . \XF::app()->router()->buildLink( 'canonical:account' ) . '">Profile</a>'; ?>
<?php echo '<a class="xenword_logout logout" href="' . \XF::app()->router()->buildLink( 'canonical:logout', $visitor, array(
'_xfToken' => $visitor['csrf_token_page'],
'redirect' => $redirect_out
) ) . '">Logout</a>'; ?>
I'm thinking it is the $visitor array but maybe there is a better way to do this rather than the above code.
Update:
htmlspecialchars($this->app['csrf.token'])
is the value for _xfToken
but I'm not calling it right.
Code:
<?php echo '<a class="xenword_logout logout" href="' . \XF::app()->router()->buildLink( 'canonical:logout', $visitor, array(
'_xfToken' => htmlspecialchars(\XF::app()->app['csrf.token']),
'redirect' => $redirect_out
) ) . '">Logout</a>'; ?>
It's getting a container key app error.
'_xfToken' => htmlspecialchars(\XF::app()->container( 'csrf.token' ) ),
But stuck on the same error.
Thank you for your help.
Last edited: