kinde-oss / kinde-react-native-sdk-0-7x

Kinde React Native SDK for authentication for 0.7x
MIT License
21 stars 9 forks source link

Bug: kinde login in android (React Native) #28

Closed Yashsharma4way closed 8 months ago

Yashsharma4way commented 10 months ago

Prerequisites

Describe the issue

InAppBrowser closes when I switch my app to go to gmail to check for OTP and when I come back to my application to enter the OTP, what I find is the InAppBrowser is closed so i need to start it again

Basically InAppBrowser is closed when we switch betweeen apps

facing this issue in android devices


export default function useAuth() {
  const dispatch = useDispatch();
  const client = new KindeSDK(
    config.VITE_KINDE_DOMAIN,
    config.VITE_KINDE_POST_CALLBACK_URL,
    config.VITE_KINDE_CLIENT_ID,
    config.VITE_KINDE_POST_LOGOUT_REDIRECT_URL,
  );
  const isAuthenticated = async () => await client.isAuthenticated;
  const getToken = async () => await Storage.getToken();
  const getProfile = async () => await client.getUserDetails();
  const getPermissions = async () => await client.getPermissions();
  const login = async () => {
    const token = await client.login();
    if (token) {
      jsonApiService.setUserToken(token.access_token);
      dispatch(setKindeToken(token));

      const userProfile = await client.getUserDetails();
      dispatch(setKindeUser(userProfile));

      const permission = await client.getPermissions();
      dispatch(setPermission(permission?.permissions));
      return true;
    }
    return false;
  };

Library URL

https://github.com/kinde-oss/kinde-react-native-sdk-0-7x

Library version

v1.1

Operating system(s)

Windows

Operating system version(s)

11

Further environment details

"react-native": "0.72.6", facing the issue for Android devices

Reproducible test case URL

No response

Additional information

No response

onderay commented 9 months ago

@Yashsharma4way the github repo has been updated, about to confirm the issue you are facing has been fixed?

bmpickford commented 2 months ago

Not sure if you found a resolution @Yashsharma4way but I'm seeing this issue on version 1.3.0, likely related to https://github.com/proyecto26/react-native-inappbrowser/issues/213