getAttribute(UserEntity::class); $cmd = new AcceptInvitationCommand( $user, $request->getAttribute("id"), $request->getAttribute("iid") ); try { $this->dispatcher->dispatch($cmd); } catch (WorkspaceNotFoundException | InvitationNotFoundException $th) { return new RedirectResponse("/app/workspace"); } return new ViewResponse( '/templates/app/workspace/overview.twig', ['show_invitation_accepted_toast' => true] ); } }