mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-22 22:32:01 -05:00
fix(expo): expo-web-browser is not installed as a dependency (#7752)
Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
@@ -360,18 +360,22 @@ export const expoClient = (opts: ExpoClientOptions) => {
|
||||
undefined;
|
||||
try {
|
||||
Browser = await import("expo-web-browser");
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
'"expo-web-browser" is not installed as a dependency!',
|
||||
{
|
||||
cause: error,
|
||||
},
|
||||
);
|
||||
} catch {
|
||||
try {
|
||||
Browser = require("expo-web-browser");
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
'"expo-web-browser" is not installed as a dependency!',
|
||||
{
|
||||
cause: error,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (Platform.OS === "android") {
|
||||
try {
|
||||
Browser.dismissAuthSession();
|
||||
Browser!.dismissAuthSession();
|
||||
} catch {}
|
||||
}
|
||||
|
||||
@@ -387,7 +391,7 @@ export const expoClient = (opts: ExpoClientOptions) => {
|
||||
params.append("oauthState", oauthStateValue);
|
||||
}
|
||||
const proxyURL = `${context.request.baseURL}/expo-authorization-proxy?${params.toString()}`;
|
||||
const result = await Browser.openAuthSessionAsync(
|
||||
const result = await Browser!.openAuthSessionAsync(
|
||||
proxyURL,
|
||||
to,
|
||||
opts?.webBrowserOptions,
|
||||
|
||||
Reference in New Issue
Block a user