/** @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);
}
};
.....
/** @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);
}
};
.....