KindeK
Kinde2y ago
TEKIMAX

Unable to Complete Login Process - Authentication Error

I'm reaching out for assistance with an issue I'm encountering during the login process. I've successfully navigated through the authentication steps and reached the point where I'm verified with a confirmation code. However, I'm unable to complete the login process due to an error that appears post-redirect. The error message displayed is:

"ERROR: Something wrong when trying to authenticate. Reason: cancel"

This issue prevents me from accessing my account, and it occurs right after the verification step. It seems like the authentication process gets cancelled unexpectedly. Could you please provide guidance or a solution to resolve this issue?

Thank you for your time and assistance.

here is the code snippet--
/** @format */

import { useState, useEffect, useContext, createContext } from "react";
import { KindeSDK } from "@kinde-oss/react-native-sdk-0-7x";
import * as AuthSession from "expo-auth-session";

// Initialize the Kinde SDK client
const client = new KindeSDK(
  process.env.EXPO_PUBLIC_KINDE_ISSUER_URL ?? "",
  process.env.EXPO_PUBLIC_KINDE_POST_CALLBACK_URL ?? "",
  process.env.EXPO_PUBLIC_KINDE_CLIENT_ID ?? "",
  process.env.EXPO_PUBLIC_KINDE_POST_LOGOUT_REDIRECT_URL ?? ""
);


function useProvideAuth() {
  const [user, setUser] = useState(null);

  const signIn = async () => {
    const token = await client.login();
    try {
      if (token) {
        // Update user state
        setUser({ token });
        console.log(token);
      }
    } catch (e) {
      console.log(e);
    }
  };
.....
IMG_2816.webp
Was this page helpful?