Create profile temp password

This commit is contained in:
Dennis Eichhorn 2020-12-20 19:58:09 +01:00
parent bf2abd8b8d
commit 04d95f114d

View File

@ -92,6 +92,32 @@ final class ApiController extends Controller
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.
*