!skyfall
!skyfall
Explore posts from servers
BABetter Auth
Created by !skyfall on 4/27/2025 in #help
API Key plugin is always returning a KEY_NOT_FOUND error
Here's the fix, for those interested:
apiKey({
customKeyGenerator: async () => {
return crypto.randomUUID();
},
+ defaultKeyLength: 32,
}),
apiKey({
customKeyGenerator: async () => {
return crypto.randomUUID();
},
+ defaultKeyLength: 32,
}),
8 replies
BABetter Auth
Created by !skyfall on 4/27/2025 in #help
API Key plugin is always returning a KEY_NOT_FOUND error
Looks like I'm triggering this check
// if the key is shorter than the default key length, than we know the key is invalid.
// we can't check if the key is exactly equal to the default key length, because
// a prefix may be added to the key.
+ console.log("Oops!")
return ctx.json({
valid: false,
error: {
message: ERROR_CODES.INVALID_API_KEY,
code: "KEY_NOT_FOUND" as const,
},
key: null,
});
// if the key is shorter than the default key length, than we know the key is invalid.
// we can't check if the key is exactly equal to the default key length, because
// a prefix may be added to the key.
+ console.log("Oops!")
return ctx.json({
valid: false,
error: {
message: ERROR_CODES.INVALID_API_KEY,
code: "KEY_NOT_FOUND" as const,
},
key: null,
});
8 replies
BABetter Auth
Created by !skyfall on 4/27/2025 in #help
API Key plugin is always returning a KEY_NOT_FOUND error
Strangely enough, I get the same error even if I create an API key and use it straight after:
const { key: key1 } = await auth.api.createApiKey({
body: {
userId: "8tNfVAUgtAMz0KnGMpNVoJbXaN3T0xnZ",
},
});

console.log("Key 1:", JSON.stringify(key1));

const { error, key } = await auth.api.verifyApiKey({
body: {
key: key1,
},
});
const { key: key1 } = await auth.api.createApiKey({
body: {
userId: "8tNfVAUgtAMz0KnGMpNVoJbXaN3T0xnZ",
},
});

console.log("Key 1:", JSON.stringify(key1));

const { error, key } = await auth.api.verifyApiKey({
body: {
key: key1,
},
});
8 replies
BABetter Auth
Created by !skyfall on 4/27/2025 in #help
API Key plugin is always returning a KEY_NOT_FOUND error
And here's the full error that Better Auth returns:
{ message: 'Invalid API key.', code: 'KEY_NOT_FOUND' }
{ message: 'Invalid API key.', code: 'KEY_NOT_FOUND' }
8 replies
BABetter Auth
Created by !skyfall on 4/27/2025 in #help
API Key plugin is always returning a KEY_NOT_FOUND error
8 replies
BABetter Auth
Created by !skyfall on 4/26/2025 in #help
Custom format for API Key
Solution:
plugins: [
apiKey({
customKeyGenerator: async () => {
return crypto.randomUUID();
},
}),
],
plugins: [
apiKey({
customKeyGenerator: async () => {
return crypto.randomUUID();
},
}),
],
4 replies
CDCloudflare Developers
Created by !skyfall on 4/25/2025 in #general-help
Cloudflare is blocking cURL requests to my static assets
Got it - thanks for your help!
6 replies
CDCloudflare Developers
Created by !skyfall on 4/25/2025 in #general-help
Cloudflare is blocking cURL requests to my static assets
I don't want bots accessing any URLs other than those two
6 replies
CDCloudflare Developers
Created by !skyfall on 4/25/2025 in #general-help
Cloudflare is blocking cURL requests to my static assets
Is there a way to only do it for two URLs though?
6 replies
BABetter Auth
Created by !skyfall on 4/20/2025 in #help
Setting an `apiKey` additional field on users
Cool, thanks again
7 replies
BABetter Auth
Created by !skyfall on 4/20/2025 in #help
Setting an `apiKey` additional field on users
One more question: I'm using Drizzle too and I noticed that I have to make the API Key column nullable to allow creating users. It works, but how do you deal with TypeScript complaining that apiKey could be undefined even though it definitely won't?
7 replies
BABetter Auth
Created by !skyfall on 4/20/2025 in #help
Setting an `apiKey` additional field on users
got it, thank you!
7 replies
CDCloudflare Developers
Created by Julius | klixx on 3/10/2025 in #general-help
Subdomain (CNAME / Certificate)
this is a coolify issue not a CF one, I'd try asking in their discord
6 replies
CDCloudflare Developers
Created by Julius | klixx on 3/10/2025 in #general-help
Subdomain (CNAME / Certificate)
Don't quote me on this but I think you gotta configure Traefik for that
6 replies
CDCloudflare Developers
Created by !skyfall on 3/10/2025 in #general-help
CNAME Cross-User Banned
Got it, thanks!
5 replies
CDCloudflare Developers
Created by !skyfall on 3/10/2025 in #general-help
CNAME Cross-User Banned
Might be a silly question but would it work if his Uptime Kuma instance is on a subdomain too?
5 replies
CDCloudflare Developers
Created by Julius | klixx on 3/10/2025 in #general-help
Subdomain (CNAME / Certificate)
Are you using Coolify?
6 replies
LTLeaning Technologies
Created by Mat on 11/26/2024 in #support
HI all, chrome network tab show a fetch not being completed to download .../3.0/etc/passwd
then you can download it from a different url
9 replies
LTLeaning Technologies
Created by Mat on 11/26/2024 in #support
HI all, chrome network tab show a fetch not being completed to download .../3.0/etc/passwd
i suppose you could intercept the request with a service worker?
9 replies