Commit 851234b9 authored by hlarget's avatar hlarget 👹
Browse files

Merge branch 'release/2.0.3'

parents 84bf0fed 85fd083e
......@@ -24,10 +24,14 @@ class CompanyController extends Controller
*/
public function resetCompanySecret()
{
if (!in_array("OWNER", $this->getUser()->getRoles())) {
return new Response("Only owner is allowed to reset the secret", Response::HTTP_FORBIDDEN);
}
$api = $this->get("konnect.api");
$companyId = $this->getUser()->getCompanyId();
$config = $this->get('konnect.client')->getConfiguration();
return $this->json($api->resetCompanySecret($companyId, $config));
$newSecret = $api->resetCompanySecret($companyId, $config);
return $this->json(["client_secret" => $newSecret["client_secret"]]);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment