@@ -39,23 +39,17 @@ public function auth0_sso_footer( $previous_html ) {
3939 return ;
4040 }
4141
42- $ lock_options = new WP_Auth0_Lock_Options ();
42+ $ lock_options = new WP_Auth0_Lock10_Options ();
4343
4444 $ sso = $ lock_options ->get_sso ();
4545
4646 if ( $ sso ) {
47- $ cdn = $ lock_options ->get_cdn_url ();
4847 $ client_id = $ lock_options ->get_client_id ();
4948 $ domain = $ lock_options ->get_domain ();
49+ $ cdn = $ this ->a0_options ->get ('auth0js-cdn ' );
5050
51- wp_enqueue_script ( 'wpa0_lock ' , $ cdn , 'jquery ' );
52-
53- if ($ this ->a0_options ->get ('use_lock_10 ' )) {
54- include WPA0_PLUGIN_DIR . 'templates/auth0-sso-handler-lock10.php ' ;
55- } else {
56- include WPA0_PLUGIN_DIR . 'templates/auth0-sso-handler.php ' ;
57- }
58-
51+ wp_enqueue_script ( 'wpa0_auth0js ' , $ cdn );
52+ include WPA0_PLUGIN_DIR . 'templates/auth0-sso-handler-lock10.php ' ;
5953 }
6054 }
6155 public function auth0_singlelogout_footer ( $ previous_html ) {
@@ -79,12 +73,11 @@ public function auth0_singlelogout_footer( $previous_html ) {
7973 return ;
8074 }
8175
82- $ cdn = $ this ->a0_options ->get ( ' cdn_url ' );
76+ $ cdn = $ this ->a0_options ->get (' auth0js-cdn ' );
8377 $ client_id = $ this ->a0_options ->get ( 'client_id ' );
8478 $ domain = $ this ->a0_options ->get ( 'domain ' );
8579 $ logout_url = wp_logout_url ( get_permalink () ) . '&SLO=1 ' ;
8680
87- wp_enqueue_script ( 'wpa0_lock ' , $ cdn , 'jquery ' );
8881 include WPA0_PLUGIN_DIR . 'templates/auth0-singlelogout-handler.php ' ;
8982 }
9083
@@ -162,7 +155,7 @@ public function init_auth0() {
162155 $ this ->implicit_login ();
163156 } else {
164157 $ this ->redirect_login ();
165- }
158+ }
166159 } catch (WP_Auth0_LoginFlowValidationException $ e ) {
167160
168161 $ msg = __ ( 'There was a problem with your log in ' , WPA0_LANG );
@@ -182,7 +175,7 @@ public function init_auth0() {
182175 } catch (Exception $ e ) {
183176
184177 }
185-
178+
186179 }
187180
188181 public function redirect_login () {
@@ -257,7 +250,7 @@ public function redirect_login() {
257250 WP_Auth0_ErrorManager::insert_auth0_error ( 'init_auth0_userinfo ' , $ response );
258251
259252 error_log ( $ response ->get_error_message () );
260-
253+
261254 throw new WP_Auth0_LoginFlowValidationException ( );
262255 }
263256
@@ -389,7 +382,7 @@ private function do_login( $user, $userinfo, $is_new, $id_token, $access_token )
389382 "user_login " => $ user ->user_login ,
390383 "user_password " => null ,
391384 "remember " => $ remember_users_session
392- )
385+ )
393386 );
394387
395388 //wp_set_current_user( $user->ID, $user->user_login );
@@ -437,7 +430,7 @@ public function login_user( $userinfo, $id_token, $access_token ) {
437430 if ( isset ( $ userinfo ->email ) && $ user ->data ->user_email !== $ userinfo ->email ) {
438431
439432 $ description = $ user ->data ->description ;
440-
433+
441434 if (empty ($ description )){
442435 if (isset ($ userinfo ->headline )) {
443436 $ description = $ userinfo ->headline ;
@@ -453,10 +446,10 @@ public function login_user( $userinfo, $id_token, $access_token ) {
453446 }
454447 }
455448
456- $ user_id = wp_update_user ( array (
457- 'ID ' => $ user ->data ->ID ,
458- 'user_email ' => $ userinfo ->email ,
459- 'description ' => $ description ,
449+ $ user_id = wp_update_user ( array (
450+ 'ID ' => $ user ->data ->ID ,
451+ 'user_email ' => $ userinfo ->email ,
452+ 'description ' => $ description ,
460453 ) );
461454 }
462455
0 commit comments