authClient.getSession never throws

authClient.getSession appears to never throw no matter the settings. I tried:
export const authClient = createAuthClient({
baseURL: envConfig.VITE_BETTER_AUTH_URL,
fetchOptions: {
throw: true,
},
});
export const authClient = createAuthClient({
baseURL: envConfig.VITE_BETTER_AUTH_URL,
fetchOptions: {
throw: true,
},
});
authClient.getSession({}, { throw: true })
authClient.getSession({}, { throw: true })
authClient.getSession({ fetchOptions: { throw: true } })
authClient.getSession({ fetchOptions: { throw: true } })
authClient.getSession({ fetchOptions: { throw: true } }, { throw: true })
authClient.getSession({ fetchOptions: { throw: true } }, { throw: true })
and it always returns null instead of throwing on error 401 like other methods do, like signIn throws an error 401 if i enter wrong pass/email etc
1 Reply
h3llo
h3lloOP4mo ago
bump

Did you find this page helpful?