mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-03-30 09:56:05 +02:00
Fix null group_id on twofaccount creation with specific default group
This commit is contained in:
parent
a6d4b6c5f6
commit
6533f844d9
@ -92,7 +92,7 @@ public function store(TwoFAccountDynamicRequest $request)
|
|||||||
// Possible group association
|
// Possible group association
|
||||||
$this->groupService->assign($twofaccount->id);
|
$this->groupService->assign($twofaccount->id);
|
||||||
|
|
||||||
return (new TwoFAccountReadResource($twofaccount))
|
return (new TwoFAccountReadResource($twofaccount->refresh()))
|
||||||
->response()
|
->response()
|
||||||
->setStatusCode(201);
|
->setStatusCode(201);
|
||||||
}
|
}
|
||||||
@ -178,6 +178,7 @@ public function otp(Request $request, $id = null)
|
|||||||
$otp = $this->twofaccountService->getOTP($validatedData['uri']);
|
$otp = $this->twofaccountService->getOTP($validatedData['uri']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// return bad request if uri is provided with any other input
|
||||||
else if ( count($inputs) > 1 && $request->has('uri')) {
|
else if ( count($inputs) > 1 && $request->has('uri')) {
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'message' => 'bad request',
|
'message' => 'bad request',
|
||||||
|
@ -15,7 +15,7 @@ public function toArray($request)
|
|||||||
return array_merge(
|
return array_merge(
|
||||||
[
|
[
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'group_id' => $this->group_id,
|
'group_id' => intval($this->group_id),
|
||||||
],
|
],
|
||||||
parent::toArray($request)
|
parent::toArray($request)
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user