fix
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
if ( ! function_exists('get_hybridauth_config'))
|
||||
{
|
||||
//Hybridauth configuration
|
||||
function get_hybridauth_config()
|
||||
{
|
||||
$config = array(
|
||||
|
||||
'callback' => site_url('login/auth/') ,
|
||||
|
||||
'providers' => array(
|
||||
'Google' => array(
|
||||
'enabled' => true,
|
||||
'keys' => array(
|
||||
'id' => '817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com',
|
||||
'secret' => 'aozK_2G8UjaCmLgPPkv9abIm'
|
||||
) ,
|
||||
'scope' => 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile'
|
||||
) ,
|
||||
|
||||
'Facebook' => array(
|
||||
'enabled' => true,
|
||||
'keys' => array(
|
||||
'id' => (ENVIRONMENT == 'development') ? '390204307987009' : '390204307987009',
|
||||
'secret' => (ENVIRONMENT == 'development') ? '19f778e312f2ab96d147bacb612910c2' : '19f778e312f2ab96d147bacb612910c2'
|
||||
) ,
|
||||
'scope' => 'email, public_profile'
|
||||
) ,
|
||||
|
||||
'Apple' => array(
|
||||
"enabled" => true,
|
||||
"keys" => [
|
||||
"id" => "Your Apple ID",
|
||||
"team_id" => "Your Apple team id",
|
||||
"key_id" => "Your Apple key id",
|
||||
"key_content" => "Your Apple key (content including BEGIN and END lines)",
|
||||
"key_file" => "Full path to your Apple key file (alternative to key_content)"
|
||||
],
|
||||
"scope" => "name email",
|
||||
"verifyTokenSignature" => true
|
||||
)
|
||||
) ,
|
||||
|
||||
'hybrid_debug' => array(
|
||||
'debug_mode' => 'info', /* none, debug, info, error */
|
||||
'debug_file' => APPPATH . '/logs/log-' . date('Y-m-d') . '.php'
|
||||
)
|
||||
);
|
||||
|
||||
return $config;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists('get_hybridauth_links'))
|
||||
{
|
||||
function get_hybridauth_links($hybrid, $router)
|
||||
{
|
||||
$login_links = array();
|
||||
|
||||
//Get enabled providers array
|
||||
$providers = $hybrid->getProviders();
|
||||
|
||||
$provider_icons = array(
|
||||
'Apple' => '/site3/assets/media/svg/brand-logos/apple-black.svg',
|
||||
'Facebook' => '/site3/assets/media/svg/brand-logos/facebook-4.svg',
|
||||
'Google' => '/site3/assets/media/svg/brand-logos/google-icon.svg'
|
||||
);
|
||||
|
||||
//List a link to login
|
||||
foreach ($providers as $provider)
|
||||
{
|
||||
$login_links[$provider] = "";
|
||||
//$href = sprintf(base_url('%s/auth/%s/') , strtolower($router->fetch_class()) , $provider);
|
||||
$href = sprintf("%s/%s/", site_url('login/auth'), $provider);
|
||||
$login_links[$provider] = $href; // .= '<a href="' . $href . '" class="btn btn-flex flex-center btn-light btn-lg w-100 mb-5">';
|
||||
if (array_key_exists($provider, $provider_icons)) {
|
||||
// $login_links[$provider] .= '<img alt="Logo" src="' . $provider_icons[$provider] . '" class="h-20px me-3">';
|
||||
}
|
||||
// $login_links[$provider] .= 'Continue with ' . $provider . '</a>';
|
||||
}
|
||||
|
||||
return $login_links;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user