sdk-generator
sdk-generator copied to clipboard
React Native SDK - Cant Auth when on testflight
hi i am having issues with using google oauth for login - I am using react native sdk - it all works when on expo go , but when i installed it to testfight it stops working - and when trying to login with google - in get invalid sucess param should be one of - localhost .... etc . here is my sign in code - let redirectUri = makeRedirectUri({ preferLocalhost: true }); console.log("Redirect URI:", redirectUri);
const url = await account.createOAuth2Token(
"google",
redirectUri,
redirectUri,
[
"profile",
"email",
"https://www.googleapis.com/auth/youtube",
"https://www.googleapis.com/auth/youtube.force-ssl",
"https://www.googleapis.com/auth/youtube.upload",
"https://www.googleapis.com/auth/youtubepartner",
]
);
console.log("URL:", url);
if (!url) {
throw new Error("Failed to create OAuth2 session");
}
const result = await openAuthSessionAsync(url.href, redirectUri);
console.log("Auth session result:", result);
if (result.type === "success") {
if ("url" in result) {
const resultUrl = new URL(result.url);
const secret = resultUrl.searchParams.get("secret");
const userId = resultUrl.searchParams.get("userId");
if (!secret || !userId) return;
await account.createSession(userId, secret);
const user = await account.get().catch((e) => {
console.warn(e);
return null;
});
console.log("user:", user);
see the screen shot for google cloud credentials
Image