LPH
Well-known member
I'm trying to build a way to use Google Authenticator (and twitter, facebook, etc) externally to log into XenForo 2.
This is my current attempt.
I'm thinking there should be a way to use the
This is my current attempt.
Code:
$options = \XF::app()->get( 'options' );
$googleClientId = $options->googleClientId;
$visitor = \XF::visitor();
echo '<span class="googleLogin GoogleLogin JsOnly" tabindex="110" data-client-id="'
. $googleClientId
. '" data-redirect-url="'
. \XF::app()->router()->buildLink( 'canonical:register/google?code=__CODE__&csrf=' . $visitor['csrf.token'] )
. '" data-gapiattached="true"><span>Log in with Google</span></span>';
I'm thinking there should be a way to use the
XF:Tfa
but am lost in that code. Any guidance would be helpful.
Code:
/** @var \XF\Repository\Tfa $tfaRepo */
$tfaRepo = \XF::repository('XF:Tfa');
$tfaRepo->updateUserTfaData($user, $provider, $newProviderData);