Aidam
Aidam
TTCTheo's Typesafe Cult
Created by Aidam on 11/19/2023 in #questions
tRPC loading state
Apparently tRPC returns isFetching which on first glance can be used as a loading state
const { data, isFetching } = api...useQuery();
const { data, isFetching } = api...useQuery();
4 replies
TTCTheo's Typesafe Cult
Created by Aidam on 11/16/2023 in #questions
NextAuth google provider sometimes doesn't fetch image
The image is stored via a link to google, how can I store it directly in my db?
6 replies
TTCTheo's Typesafe Cult
Created by Aidam on 10/22/2023 in #questions
How can I access the entire user model and not just id, name, email and image?
my authoptions file is structured like this, should I rewrite it with the return options?
export const authOptions: NextAuthOptions = {
callbacks: {
session: ({ session, user }) => ({
...session,
user: {
...session.user,
id: user.id,
},
}),
},
...
export const authOptions: NextAuthOptions = {
callbacks: {
session: ({ session, user }) => ({
...session,
user: {
...session.user,
id: user.id,
},
}),
},
...
8 replies
TTCTheo's Typesafe Cult
Created by Aidam on 10/22/2023 in #questions
How can I access the entire user model and not just id, name, email and image?
Okay, I'll take a look today
8 replies
TTCTheo's Typesafe Cult
Created by Aidam on 10/21/2023 in #questions
Run additional code on user creation
Yep, I was using a react hook so it didn't work
11 replies
TTCTheo's Typesafe Cult
Created by Aidam on 10/21/2023 in #questions
Run additional code on user creation
The user still gets created like normal but the added code is disregarded
11 replies
TTCTheo's Typesafe Cult
Created by Aidam on 10/21/2023 in #questions
Run additional code on user creation
Because it doesn't xD
11 replies
TTCTheo's Typesafe Cult
Created by Aidam on 10/21/2023 in #questions
Run additional code on user creation
No description
11 replies
TTCTheo's Typesafe Cult
Created by Aidam on 10/21/2023 in #questions
Run additional code on user creation
auth.ts
export const authOptions: NextAuthOptions = {
...
events: {
async createUser(){
const createGroupMutation = api.groups.create.useMutation();
const createGroup = async (name: string) => {
await createGroupMutation.mutateAsync({
name,
memberIDs: []
})
}
await createGroup("session created");
},
},
export const authOptions: NextAuthOptions = {
...
events: {
async createUser(){
const createGroupMutation = api.groups.create.useMutation();
const createGroup = async (name: string) => {
await createGroupMutation.mutateAsync({
name,
memberIDs: []
})
}
await createGroup("session created");
},
},
So something like this should work?
11 replies