generator101
generator101
Explore posts from servers
BABetter Auth
Created by generator101 on 4/6/2025 in #help
How to update `api/auth/get-session` with new session data?
session: {
cookieCache: {
enabled: false,
},
},
session: {
cookieCache: {
enabled: false,
},
},
33 replies
BABetter Auth
Created by generator101 on 4/6/2025 in #help
How to update `api/auth/get-session` with new session data?
@bekacru Yes, you were right, in my config I had it enabled, after disabling it everything gets invalidated
33 replies
BABetter Auth
Created by generator101 on 4/6/2025 in #help
How to update `api/auth/get-session` with new session data?
I am building a profile page where users can edit their name, so upon submission I want to update the session
33 replies
BABetter Auth
Created by generator101 on 4/6/2025 in #help
How to update `api/auth/get-session` with new session data?
@bekacru thanks for the response, is it possible the queryClient.invalidateQueries invalidate the cache?
33 replies
BABetter Auth
Created by generator101 on 4/6/2025 in #help
How to update `api/auth/get-session` with new session data?
queryClient.invalidateQueries({ queryKey: ['user'] })
router.invalidate()
queryClient.invalidateQueries({ queryKey: ['user'] })
router.invalidate()
33 replies
BABetter Auth
Created by generator101 on 4/6/2025 in #help
How to update `api/auth/get-session` with new session data?
and this is how I invalidate the session after database update:
33 replies
BABetter Auth
Created by generator101 on 4/6/2025 in #help
How to update `api/auth/get-session` with new session data?
const getUser = createServerFn({ method: 'GET' }).handler(async () => {
const { headers } = getWebRequest()!
const session = await auth.api.getSession({ headers })

return session?.user || null
})

beforeLoad: async ({ context }) => {
const user = await context.queryClient.fetchQuery({
queryKey: ['user'],
queryFn: ({ signal }) => getUser({ signal }),
})
return { user }
},
const getUser = createServerFn({ method: 'GET' }).handler(async () => {
const { headers } = getWebRequest()!
const session = await auth.api.getSession({ headers })

return session?.user || null
})

beforeLoad: async ({ context }) => {
const user = await context.queryClient.fetchQuery({
queryKey: ['user'],
queryFn: ({ signal }) => getUser({ signal }),
})
return { user }
},
33 replies
BABetter Auth
Created by generator101 on 4/6/2025 in #help
How to update `api/auth/get-session` with new session data?
The server function in __root.tsx
33 replies
BABetter Auth
Created by generator101 on 4/6/2025 in #help
How to update `api/auth/get-session` with new session data?
// /routes/api/auth/.ts'
import { createAPIFileRoute } from '@tanstack/react-start/api'

import { auth } from '@/lib/auth'

export const APIRoute = createAPIFileRoute('/api/auth/$')({
GET: ({ request }) => auth.handler(request),
POST: ({ request }) => auth.handler(request),
})
// /routes/api/auth/.ts'
import { createAPIFileRoute } from '@tanstack/react-start/api'

import { auth } from '@/lib/auth'

export const APIRoute = createAPIFileRoute('/api/auth/$')({
GET: ({ request }) => auth.handler(request),
POST: ({ request }) => auth.handler(request),
})
33 replies
CACrawlee & Apify
Created by relaxed-coral on 6/5/2023 in #apify-platform
How to access key-value-stores via api?
do you have an example?
5 replies
CACrawlee & Apify
Created by correct-apricot on 6/5/2023 in #apify-platform
How to access key-value-stores via api?
@HonzaS thanks, the file is already in key_value_stores/default but accessing that file via api url is not possible because it requires Store Id which changes in run time
5 replies
CACrawlee & Apify
Created by ratty-blush on 6/5/2023 in #apify-platform
How to modify the dataset
I tried this
await Dataset.drop()
await Dataset.drop()
but I get TypeError: Dataset.drop is not a function
5 replies
CACrawlee & Apify
Created by genetic-orange on 6/5/2023 in #crawlee-js
web scrapper create 1 file instead of multiple output for pagination
sorry for posting to the wrong forum, I didnt notice that. What about this reduce? https://crawlee.dev/api/core/class/Dataset#reduce
13 replies
CACrawlee & Apify
Created by ambitious-aqua on 6/5/2023 in #crawlee-js
web scrapper create 1 file instead of multiple output for pagination
I want to have
{
"data": [
// data for all pages
],
}
]
{
"data": [
// data for all pages
],
}
]
13 replies
CACrawlee & Apify
Created by stormy-gold on 6/5/2023 in #crawlee-js
web scrapper create 1 file instead of multiple output for pagination
right now it is like this:
{
"url": "example.com/page/1",
"data": [
],
},
{
"url": "example.com/page/2",
"data": [
],
}
]
{
"url": "example.com/page/1",
"data": [
],
},
{
"url": "example.com/page/2",
"data": [
],
}
]
13 replies
CACrawlee & Apify
Created by passive-yellow on 6/5/2023 in #crawlee-js
web scrapper create 1 file instead of multiple output for pagination
if I use await Dataset.exportToJSON('results'); it just combines the json files, I want the data to be under data key
13 replies
CACrawlee & Apify
Created by rival-black on 6/5/2023 in #crawlee-js
web scrapper create 1 file instead of multiple output for pagination
I want all the data from the 20 pages to be present in 1 file
13 replies
CACrawlee & Apify
Created by optimistic-gold on 6/5/2023 in #crawlee-js
web scrapper create 1 file instead of multiple output for pagination
yes, I tried using await Dataset.pushData to create a single large file , in this page "https://crawlee.dev/docs/introduction/saving-data#whats-datasetpushdata" it says "If you would like to store your data in a single big file, instead of many small ones, see the Result storage guide for Key-value stores."
13 replies
CACrawlee & Apify
Created by yappiest-sapphire on 6/5/2023 in #crawlee-js
web scrapper create 1 file instead of multiple output for pagination
@Andrey Bykov can you please help me with this? I can't find a solution and searched every where
13 replies
CACrawlee & Apify
Created by yelping-magenta on 6/5/2023 in #crawlee-js
web scrapper create 1 file instead of multiple output for pagination
also very similar to this : https://docs.apify.com/sdk/js/docs/examples/add-data-to-dataset but instead of having individual files, how can I have one file?
13 replies