mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2026-01-20 07:03:02 -05:00
Potential fix for code scanning alert no. 2: Incomplete URL substring sanitization
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
@@ -169,11 +169,12 @@ export function WalletTab() {
|
|||||||
*/
|
*/
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Check if we're in a Farcaster client environment
|
// Check if we're in a Farcaster client environment
|
||||||
const isInFarcasterClient = typeof window !== 'undefined' &&
|
const isInFarcasterClient = typeof window !== 'undefined' && (() => {
|
||||||
(window.location.href.includes('warpcast.com') ||
|
const hostname = window.location.hostname.toLowerCase();
|
||||||
window.location.href.includes('farcaster') ||
|
const isWarpcastHost = hostname === 'warpcast.com' || hostname.endsWith('.warpcast.com');
|
||||||
window.ethereum?.isFarcaster ||
|
const isFarcasterHost = hostname === 'farcaster.com' || hostname.endsWith('.farcaster.com');
|
||||||
context?.client);
|
return isWarpcastHost || isFarcasterHost || window.ethereum?.isFarcaster || context?.client;
|
||||||
|
})();
|
||||||
|
|
||||||
if (context?.user?.fid && !isConnected && connectors.length > 0 && isInFarcasterClient) {
|
if (context?.user?.fid && !isConnected && connectors.length > 0 && isInFarcasterClient) {
|
||||||
console.log("Attempting auto-connection with Farcaster context...");
|
console.log("Attempting auto-connection with Farcaster context...");
|
||||||
|
|||||||
Reference in New Issue
Block a user