Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit f7dcad7

Browse files
committed
Added syncModelPassword method for ability to be overridden
1 parent 7ef8746 commit f7dcad7

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/AdldapAuthUserProvider.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ protected function getModelFromAdldap(User $user, $password)
106106
// Set the username and password in case
107107
// of changes in active directory
108108
$model->{$key} = $username;
109-
$model->password = bcrypt($password);
109+
110+
// Sync the users password
111+
$model = $this->syncModelPassword($model, $password);
110112

111113
// Synchronize other active directory
112114
// attributes on the model
@@ -149,6 +151,21 @@ protected function syncModelFromAdldap(User $user, Authenticatable $model)
149151
return $model;
150152
}
151153

154+
/**
155+
* Syncs the models password with the specified password.
156+
*
157+
* @param Authenticatable $model
158+
* @param string $password
159+
*
160+
* @return Authenticatable
161+
*/
162+
protected function syncModelPassword(Authenticatable $model, $password)
163+
{
164+
$model->password = bcrypt($password);
165+
166+
return $model;
167+
}
168+
152169
/**
153170
* Retrieves the Adldap User model from the
154171
* specified Laravel model.

0 commit comments

Comments
 (0)