Aditya Kirad
Aditya Kirad
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Aditya Kirad on 3/22/2024 in #questions
redirecting to custom error page if auth is canceled
hey folks I'm using discord for auth in my t3 app I want user to redirected to a custom error page if oauth is cancelled so I added
pages: {
error: "/oauth/error
}
pages: {
error: "/oauth/error
}
to authOption but when I cancel the oauth the user is get redirected to /api/auth/signin?error=Callback instead
2 replies
TTCTheo's Typesafe Cult
Created by Aditya Kirad on 1/11/2024 in #questions
setuping prettier and eslint with new next app
No description
3 replies
TTCTheo's Typesafe Cult
Created by Aditya Kirad on 12/23/2023 in #questions
Loading UI not showing
hey folks I'm using the T3 stack with app router I'm fetching some data and on the basis of data I'm generating the component I have wrapped that in a Suspense and I provided a fallback also but until the components aren't ready the loading UI doesn't shows up the page loads with full content here is my code
import { redirect } from "next/navigation";
import { Suspense } from "react";
import { getServerAuthSession } from "@/server/auth";
import { api } from "@/trpc/server";
import { Container, Grid, Heading } from "@radix-ui/themes";
import GuildCard, { LoadingGuildCard } from "@/app/_components/GuildCard";

export default async function Page() {
const session = await getServerAuthSession();
if (!session || !session.user) {
redirect("/");
}
const discord = await api.discord.getGuilds.query({
userId: session.user.id,
});

return (
<Container size="3" mx="4">
<Heading className="mt-rx-8 text-center">Select a server</Heading>
<Grid className="mt-rx-8 gap-rx-4 md:grid-cols-2 lg:grid-cols-3">
<Suspense fallback={<LoadingGuildCard />}>
{discord?.guilds?.map((guild) => (
<GuildCard key={guild.id} guild={guild} />
))}
</Suspense>
</Grid>
</Container>
);
}
import { redirect } from "next/navigation";
import { Suspense } from "react";
import { getServerAuthSession } from "@/server/auth";
import { api } from "@/trpc/server";
import { Container, Grid, Heading } from "@radix-ui/themes";
import GuildCard, { LoadingGuildCard } from "@/app/_components/GuildCard";

export default async function Page() {
const session = await getServerAuthSession();
if (!session || !session.user) {
redirect("/");
}
const discord = await api.discord.getGuilds.query({
userId: session.user.id,
});

return (
<Container size="3" mx="4">
<Heading className="mt-rx-8 text-center">Select a server</Heading>
<Grid className="mt-rx-8 gap-rx-4 md:grid-cols-2 lg:grid-cols-3">
<Suspense fallback={<LoadingGuildCard />}>
{discord?.guilds?.map((guild) => (
<GuildCard key={guild.id} guild={guild} />
))}
</Suspense>
</Grid>
</Container>
);
}
14 replies
TTCTheo's Typesafe Cult
Created by Aditya Kirad on 12/21/2023 in #questions
need help with customizing error page if auth is failed
hey folks I'm using next-auth NextJs 14 with app router can anyone tell me how can I customize the default error page if the auth is failed
12 replies