Please provide the following details too when asking for help in this category:
- SDK Version: 8.0.7-alpha.0
Hello , I am currently having issues trying to setup my custom verifier with tKey. I have the following setup + trigger login. Essentially we have a custom verifier setup with firebase, which on successful login returns an id_token which we then pass to web3Auth. Currently getting the following error though … Keep in mind this verifier works as expected when using the Web3AuthNoModal sdk.
import ThresholdKey from '@tkey/default';
import WebStorageModule from '@tkey/web-storage';
// Configuration of Service Provider
const customAuthArgs = {
baseUrl: window.location.origin,
redirectPathName: 'auth',
enableLogging: true,
uxMode: 'redirect',
network: 'testnet', // based on the verifier network.
};
// Configuration of Modules
const webStorageModule = new WebStorageModule(true);
// Instantiation of tKey
export const tKey = new ThresholdKey({
modules: {
webStorage: webStorageModule,
},
customAuthArgs: customAuthArgs as any,
});
import { tKey } from '../web3AuthCoreKit/tkey';
// Init Service Provider inside the useEffect Method
useEffect(() => {
const init = async () => {
try {
await (tKey.serviceProvider as any).init({ skipSw: true });
if (
window.location.pathname === '/auth' &&
window.location.hash.includes('#state')
) {
let result = await (tKey.serviceProvider as any).directWeb.getRedirectResult();
console.log('result', result);
}
} catch (error) {
console.error('init::error', error);
}
};
init();
}, [privateKey]);
const triggerLogin = async (token: string) => {
if (!tKey) {
console.log('tKey not initialized yet');
return;
}
try {
const loginResponse = await (tKey.serviceProvider as any).triggerLogin({
typeOfLogin: 'jwt',
verifier: 'my-firebase-verifier',
clientId:
'firebase-clientID',
jwtParams: {
domain: window.location.origin,
id_token: token,
client_id:
'firebase-clientID',
verifierIdField: 'sub',
},
});
console.log('loginResponse', loginResponse);
setUser(loginResponse?.userInfo);
setOAuthShare(loginResponse?.privateKey);
} catch (error) {
console.log('triggerLogin::error', error);
}
};