mirror of
https://github.com/Karaka-Management/oms-Profile.git
synced 2026-02-15 23:08:40 +00:00
Create profile temp password
This commit is contained in:
parent
bf2abd8b8d
commit
04d95f114d
|
|
@ -92,6 +92,32 @@ final class ApiController extends Controller
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Profile $profile Profile to create in the database
|
||||||
|
* @param RequestAbstract $request Request
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function apiProfileTempLoginCreate(Profile $profile, RequestAbstract $request) : void
|
||||||
|
{
|
||||||
|
$account = AccountMapper::get($reqeust->header->account);
|
||||||
|
$account->tempPassword = \password_hash(\random_bytes(64), \PASSWORD_DEFAULT);
|
||||||
|
|
||||||
|
$this->updateModel($request->header->account, $old, $profile, AccountMapper::class, 'profile', $request->getOrigin());
|
||||||
|
|
||||||
|
$this->fillJsonResponse(
|
||||||
|
$request, $response,
|
||||||
|
$status ? NotificationLevel::OK : NotificationLevel::WARNING,
|
||||||
|
'Profil',
|
||||||
|
'Temp password successfully created.',
|
||||||
|
$account->tempPassword
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to create profile from request.
|
* Method to create profile from request.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user