mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-25 11:45:58 +00:00
Updated user-create endpoint so saml and ldap is consistent.
This commit is contained in:
parent
519283e643
commit
07831df2d3
@ -76,7 +76,7 @@ class UserController extends Controller
|
|||||||
if ($authMethod === 'standard' && !$sendInvite) {
|
if ($authMethod === 'standard' && !$sendInvite) {
|
||||||
$validationRules['password'] = 'required|min:6';
|
$validationRules['password'] = 'required|min:6';
|
||||||
$validationRules['password-confirm'] = 'required|same:password';
|
$validationRules['password-confirm'] = 'required|same:password';
|
||||||
} elseif ($authMethod === 'ldap') {
|
} elseif ($authMethod === 'ldap' || $authMethod === 'saml2') {
|
||||||
$validationRules['external_auth_id'] = 'required';
|
$validationRules['external_auth_id'] = 'required';
|
||||||
}
|
}
|
||||||
$this->validate($request, $validationRules);
|
$this->validate($request, $validationRules);
|
||||||
@ -85,7 +85,7 @@ class UserController extends Controller
|
|||||||
|
|
||||||
if ($authMethod === 'standard') {
|
if ($authMethod === 'standard') {
|
||||||
$user->password = bcrypt($request->get('password', Str::random(32)));
|
$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');
|
$user->external_auth_id = $request->get('external_auth_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user