Çağlar
Çağlar
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Çağlar on 5/25/2023 in #questions
How to migrate t3 from v6 to v7
@felipe_fga thank you so much!
4 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 5/25/2023 in #questions
How to migrate t3 from v6 to v7
?
4 replies
TTCTheo's Typesafe Cult
Created by BinarySenseiii on 5/25/2023 in #questions
how to fix next auth ts error?
void () => signIn()
void () => signIn()
5 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 3/24/2023 in #questions
How to override and update session callback's session object after signIn callback?
If anyone is wondering, this is how I did it.
4 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 3/24/2023 in #questions
How to override and update session callback's session object after signIn callback?
and is this right approach to send token to backend api?
4 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 3/24/2023 in #questions
How to override and update session callback's session object after signIn callback?
Maybe I should do these inside session callback?
4 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 3/11/2023 in #questions
What causes infinite fetch or query?
When I add the createdAt column to this category table, it does an infinite fetch. When I add something different there is no problem, just createdAt.
11 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 3/11/2023 in #questions
What causes infinite fetch or query?
11 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 3/11/2023 in #questions
What causes infinite fetch or query?
@cje I just have a table named category, when I add createdAt to this table, react query is going crazy.
I will shoot a screen recording video for you
11 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 3/11/2023 in #questions
What causes infinite fetch or query?
I was just wondering what triggers this, does react query fetch by time?
11 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 3/11/2023 in #questions
What causes infinite fetch or query?
I think it was a time related problem, because I was playing with timeStamps on prisma and it suddenly got into an infinite fetch loop
11 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 3/11/2023 in #questions
What causes infinite fetch or query?
does time difference in database make infinite fetch?
11 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 3/11/2023 in #questions
What causes infinite fetch or query?
It was so weird that I didn't even know how to ask
11 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 1/27/2023 in #questions
Best practice for Admin dashboard?
yes, I did, thank you for different approach
36 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 1/27/2023 in #questions
Best practice for Admin dashboard?
I totally agree, our problem here was to extend the user in the session
36 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 1/27/2023 in #questions
Best practice for Admin dashboard?
This method allows us to put exactly what we want inside the JWT
36 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 1/27/2023 in #questions
Best practice for Admin dashboard?
session takes user from token.user
36 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 1/27/2023 in #questions
Best practice for Admin dashboard?
In jwt we get user and return it inside token and then
36 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 1/27/2023 in #questions
Best practice for Admin dashboard?
36 replies
TTCTheo's Typesafe Cult
Created by Çağlar on 1/27/2023 in #questions
Best practice for Admin dashboard?
callbacks: {
jwt: ({ token, user }) => {
user && (token.user = user);
return token;
},
redirect({ url, baseUrl }) {
// Allows relative callback URLs
if (url.startsWith("/")) return `${baseUrl}${url}`;
// Allows callback URLs on the same origin
else if (new URL(url).origin === baseUrl) return url;
return baseUrl;
},
session: ({ session, token }) => {
session.user = {
id: token.user.id,
isAdmin: token.user.isAdmin as boolean,
role: token.user.role,
};

return session;
},
},
callbacks: {
jwt: ({ token, user }) => {
user && (token.user = user);
return token;
},
redirect({ url, baseUrl }) {
// Allows relative callback URLs
if (url.startsWith("/")) return `${baseUrl}${url}`;
// Allows callback URLs on the same origin
else if (new URL(url).origin === baseUrl) return url;
return baseUrl;
},
session: ({ session, token }) => {
session.user = {
id: token.user.id,
isAdmin: token.user.isAdmin as boolean,
role: token.user.role,
};

return session;
},
},
36 replies