getCookie() does not exist on authClient - Expo plugin errors
getCookie() does not exist on authClient and I'm getting errors from the expoClient plugin. I tried different versions but no luck.. Anyone experiencing similar or is it my fault?
import { config } from "@/config";
import { expoClient } from "@better-auth/expo/client";
import { organizationClient } from "better-auth/client/plugins";
import { createAuthClient } from "better-auth/react";
import Constants from "expo-constants";
import * as SecureStore from "expo-secure-store";
const scheme = Constants.expoConfig?.scheme;
if (typeof scheme !== "string") {
throw new Error("Expo scheme is not set");
}
const authClient = createAuthClient({
baseURL: config.serverBaseUrl,
plugins: [
expoClient({
scheme,
storage: SecureStore,
}),
organizationClient(),
],
});
export { authClient };
---
Property 'getCookie' does not exist on type '{ signIn: { social: <FetchOptions extends { method?: string | undefined; cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: (HeadersInit & (HeadersInit | CommonHeaders)) | undefined; ... 30 more ...; disableValidation?: boolean | undefined; }>(data_0: Prettify<...>, data1?: Fe...'.
---
Type '{ id: "expo"; getActions(: BetterFetch, $store: Store): { getCookie: () => string; useSession: () => any; }; fetchPlugins: { id: string; name: string; hooks: { onSuccess(context: SuccessContext<...>): Promise<...>; }; init(url: string, options: { ...; } | undefined): Promise<...>; }[]; }' is not assignable to type 'BetterAuthClientPlugin'.
Types of property 'fetchPlugins' are incompatible.16 Replies
is it a type error or it doesn't work at all?
also be on latest
Doesn’t work at all. @bekacru
just tried it on my end and it's working. try to remove org client if that's incase causing the bug. also make sure you're ong
1.1.8
or 1.1.9-beta.1
Thanks for your help, I’ll figure that out tomorrow!
Update: I cleared all types of caches and removed all node_modules folders in my repo, and now it's working again. 🙃
Hey @luksch42 how did you fix the error? What versions are you using?
@Bart ⚡ yes, I’m using a turbo repo and I guess somewhere was still an old better-auth version left which caused the error.
Currently I’m on 1.1.8
For both the plugin and the core library, right?
I'm getting also error that
getCookie
does not exist on the client 😕
@luksch42Yes, for both. Is your client config ok? I had to set the storage explicitly after upgrading which was not the case before @Bart ⚡
Let’s hop over to your issue 🙂
Hey, @luksch42 which auth providers do you have in your Expo? Are they working good?
Apple and google, working good @Bart ⚡
is callbackUrl working for you?
because for me it not redirects to the given path at the end of the request
I‘ve read the past release notes this morning and there we‘re some expo related changes after 1.1.
Maybe something related?
I'm on v1.1.10
it's the newest version, but is it working for your implementation?
I'm receiving session and I'm logged in, but I'm not redirected
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View