Hello @shahbaz ,
By changing twitter and discord you mean in typeOfLogin, like this-
twitter: {
name: "Twitter",
verifier, // Pass the Verifier name here. eg. w3a-agg-example
verifierSubIdentifier: "gamerse-twitter", // Pass the Sub-Verifier here. eg w3a-a0-github
typeOfLogin: "twitterauth0", // Pass the type of login provider. For Auth0, it's jwt and not Auth0.
clientId: "Tm1JY2xJVGpzU09VY0dTSE94RS06MTpjaQ", // Pass the Auth0 `Client ID` here.
},
discord: {
name: "Discord",
verifier, // Pass the Verifier name here. eg. w3a-agg-example
verifierSubIdentifier: "gamerse-discord", // Pass the Sub-Verifier here. eg w3a-a0-github
typeOfLogin: "discordauth0", // Pass the type of login provider. For Auth0, it's jwt and not Auth0.
clientId: "1114120776786919484", // Pass the Auth0 `Client ID` here.
},
Can you confirm on this ?
Also for connecting with social auths and wallets we are using this code-
import Navbar from "@/components/layout/Navbar";
import { verifySignature } from "@/utils/apiCalls";
import { MouseEventHandler, useEffect, useState } from "react";
import {
Connector,
useAccount,
useConnect,
useDisconnect,
useSignMessage,
} from "wagmi";
export default function Home() {
const { disconnect } = useDisconnect();
const { address, connector, isConnected } = useAccount();
const { data, signMessage, variables } = useSignMessage();
const { connect, connectors, error, isLoading, pendingConnector } =
useConnect();
const [hydrated, setHydrated] = useState(false);
const returnConnectionName = (conn: Connector) => {
return conn?.options?.loginParams?.loginProvider || conn?.name;
};
const returnValidatorForConnection = (conn: Connector) => {
if (conn.id === "web3auth") {
return (
conn?.options?.loginParams?.loginProvider ===
pendingConnector?.options?.loginParams?.loginProvider
);
}
return conn?.id === pendingConnector?.id;
};
const verifyUserSignature = async () => {
try {
const response = await verifySignature({
walletAddress: address,
message: variables?.message,
signature: data,
});
console.log(response);
} catch (error) {
console.error(error);
}
};
useEffect(() => {
setHydrated(true);
}, []);
useEffect(() => {
signMessage({
message:
"message",
});
}, [address, isConnected]);
useEffect(() => {
if (data) {
verifyUserSignature();
}
}, [data]);
if (!hydrated) {
return null;
}
return (
<div className="main">
<Navbar />
{isConnected ? (
<div>
<div className="title">
Connected to{" "}
{connector?.options.loginParams?.loginProvider ||
connector?.name}
</div>
<div>{address}</div>
<button
type="button"
className="card"
onClick={disconnect as unknown as MouseEventHandler}
>
Disconnect
</button>
</div>
) : (
<>
<div className="flex flex-col">
{connectors &&
connectors.map((conn: Connector, index) => {
const connectionName =
returnConnectionName(conn);
const validator =
returnValidatorForConnection(conn);
return (
<div
className="flex-auto"
key={index as unknown as number}
>
<button
type="button"
disabled={!conn?.ready}
key={conn?.id}
onClick={() =>
connect({ connector: conn })
}
>
{connectionName}
{!conn?.ready && " (unsupported)"}
{isLoading &&
validator &&
" (connecting)"}
</button>
<br />
<br />
{validator && error && (
<div>{error.message}</div>
)}
</div>
);
})}
</div>
</>
)}
</div>
);
}
Let me know if any change is required in this code base.