Reis
Reis
BABetter Auth
Created by Reis on 3/19/2025 in #help
The inferred type of 'authClient' cannot be named without a reference to [email protected]
After adding to my dependencies instead of devDependencies it worked
"undici-types": "^7.5.0"
"undici-types": "^7.5.0"
8 replies
BABetter Auth
Created by Reis on 3/19/2025 in #help
The inferred type of 'authClient' cannot be named without a reference to [email protected]
and the problem persists
8 replies
BABetter Auth
Created by Reis on 3/19/2025 in #help
The inferred type of 'authClient' cannot be named without a reference to [email protected]
I've also added "undici-types": "^7.5.0" to my package.json
8 replies
BABetter Auth
Created by Mad_angle on 1/1/2025 in #help
Ways to authenticate non-js api?
@Mad_angle yes, you have to use jose and validate it, something like this
const parseJwksToken = async ({ crv, x, kty, token }: ParseJwksTokenProps) => {
try {
const { payload } = await jose.compactVerify(token, {
crv,
x,
kty,
});

const decrypedToken = JSON.parse(new TextDecoder().decode(payload)) as {
id: string;
};

return decrypedToken;
} catch {
return null;
}
}
const parseJwksToken = async ({ crv, x, kty, token }: ParseJwksTokenProps) => {
try {
const { payload } = await jose.compactVerify(token, {
crv,
x,
kty,
});

const decrypedToken = JSON.parse(new TextDecoder().decode(payload)) as {
id: string;
};

return decrypedToken;
} catch {
return null;
}
}
5 replies