sdk-for-web icon indicating copy to clipboard operation
sdk-for-web copied to clipboard

๐Ÿ› Bug Report: React Native - createOAuth2Session throws error

Open KartikBazzad opened this issue 3 years ago โ€ข 5 comments

๐Ÿ‘Ÿ Reproduction steps

Start a new React Native project. Enable OAuth.

import React from 'react';
import {Button, Text, View} from 'react-native';
import {Client, Account} from 'appwrite';

const client = new Client()
  .setEndpoint('https://endpoint/v1')
  .setProject('12343455667');

const App = () => {
  function handleUserLogin() {
    const account = new Account(client);
    const session = account.createOAuth2Session('google');
    return session;
  }

  return (
    <View>
      <Text>Hello world</Text>
      <Button title="Login" onPress={handleUserLogin} />
    </View>
  );
};

๐Ÿ‘ Expected behavior

Should have opened a window for selecting an account from the OAuth client like google

๐Ÿ‘Ž Actual Behavior

Throwed Error

TypeError: Cannot set property href of [object WorkerLocation] which has only a getter

image

๐ŸŽฒ Appwrite version

Different version (specify in environment)

๐Ÿ’ป Operating system

Windows

๐Ÿงฑ Your Environment

I am using Appwrite v:1.0.1.500 React Native 0.70.1 React 18.1.0

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

  • [X] I checked and didn't find similar issue

๐Ÿข Have you read the Code of Conduct?

KartikBazzad avatar Oct 03 '22 16:10 KartikBazzad

I would like to work on this issue please

Alwinseb01 avatar Oct 04 '22 15:10 Alwinseb01