]> BookStack Code Mirror - bookstack/commitdiff
Updated user-create endpoint so saml and ldap is consistent.
authorDan Brown <redacted>
Sat, 25 Apr 2020 17:28:07 +0000 (18:28 +0100)
committerDan Brown <redacted>
Sat, 25 Apr 2020 17:28:07 +0000 (18:28 +0100)
app/Http/Controllers/UserController.php

index 775e2a984e6e8edcc8fb65906db7c208076e90dd..97ec31dcce0b2dfa2a539319afe126f23eb79788 100644 (file)
@@ -76,7 +76,7 @@ class UserController extends Controller
         if ($authMethod === 'standard' && !$sendInvite) {
             $validationRules['password'] = 'required|min:6';
             $validationRules['password-confirm'] = 'required|same:password';
-        } elseif ($authMethod === 'ldap') {
+        } elseif ($authMethod === 'ldap' || $authMethod === 'saml2') {
             $validationRules['external_auth_id'] = 'required';
         }
         $this->validate($request, $validationRules);
@@ -85,7 +85,7 @@ class UserController extends Controller
 
         if ($authMethod === 'standard') {
             $user->password = bcrypt($request->get('password', Str::random(32)));
-        } elseif ($authMethod === 'ldap') {
+        } elseif ($authMethod === 'ldap' || $authMethod === 'saml2') {
             $user->external_auth_id = $request->get('external_auth_id');
         }