Skip to content

Commit

Permalink
fix: escape base64 id on url
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmeloc22 committed Aug 10, 2024
1 parent 5721ee3 commit 133c39d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/web/src/components/chat/chat-create-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
NavigationStackTrigger,
Spinner,
} from "@ui/components";
import base64url from "base64-url";
import { AnimatePresence, LayoutGroup, motion } from "framer-motion";
import { ArrowLeft, ArrowRight, X } from "lucide-react";
import { useRouter } from "next/navigation";
Expand Down Expand Up @@ -209,7 +210,7 @@ const ChatCreateGroupMutation = graphql`
createGroupChat(input: $input) {
clientMutationId
chat {
_id
id
}
}
}
Expand Down Expand Up @@ -298,7 +299,9 @@ function GroupInfoStep({
createChat({
onCompleted: (data) => {
goBack();
router.push(`/c/${data.createGroupChat?.chat?._id}`);
router.push(
`/c/${base64url.escape(data.createGroupChat?.chat?.id ?? "")}`,
);
},
variables: {
input: {
Expand Down

0 comments on commit 133c39d

Please sign in to comment.