Browse Source

fix sso position for #946

causefx 7 years ago
parent
commit
415a5cdb65
2 changed files with 4 additions and 3 deletions
  1. 2 2
      api/functions/api-functions.php
  2. 2 1
      api/functions/auth-functions.php

+ 2 - 2
api/functions/api-functions.php

@@ -129,8 +129,8 @@ function login($array)
 				}
 			} else {
 				// Create User
-				ssoCheck($username, $password, $token);
-				return authRegister((is_array($authSuccess) && isset($authSuccess['username']) ? $authSuccess['username'] : $username), $password, defaultUserGroup(), (is_array($authSuccess) && isset($authSuccess['email']) ? $authSuccess['email'] : ''));
+				//ssoCheck($username, $password, $token);
+				return authRegister((is_array($authSuccess) && isset($authSuccess['username']) ? $authSuccess['username'] : $username), $password, defaultUserGroup(), (is_array($authSuccess) && isset($authSuccess['email']) ? $authSuccess['email'] : ''), $token);
 			}
 		} else {
 			// authentication failed

+ 2 - 1
api/functions/auth-functions.php

@@ -1,9 +1,10 @@
 <?php
-function authRegister($username, $password, $defaults, $email)
+function authRegister($username, $password, $defaults, $email, $token = null)
 {
 	if ($GLOBALS['authBackend'] !== '') {
 		ombiImport($GLOBALS['authBackend']);
 	}
+	ssoCheck($username, $password, $token);
 	if (createUser($username, $password, $defaults, $email)) {
 		writeLog('success', 'Registration Function - A User has registered', $username);
 		if ($GLOBALS['PHPMAILER-enabled']) {