StackOverflow.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (13 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

facebook login js: Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request

16 January 2026 @ 6:25 am

I know this question has been asked in here already - none of the solutions have worked for me yet. this is the code im using to get the token, from meta's documentation: window.fbAsyncInit = function() {{ FB.init({{ appId: '{APP_ID}', cookie: true, xfbml: true, version: 'v22.0' }}); }}; window.addEventListener('message', (event) => {{ if (!event.origin.endsWith('facebook.com')) return; try {{ const data = JSON.parse(event.data); if (data.type === 'WA_EMBEDDED_SIGNUP') {{ console.log('message event: ', data); }} }} catch {{ // ignore errors }} }}); const fbLoginCallback = (response) => {{ if (response.authResponse) {{ const code = response.

How can I open an accordion with an external link?

16 January 2026 @ 6:12 am

I'm trying to link from one page on my website to content in an accordion on another page, and I can't get the javascript to work for opening that accordion automatically. I've looked at a lot of other questions on here about the issue, and tried several things, but it seems like most of them pertain to people using jQuery or bootstrap, which I am not. The most baffling part is that I actually DID get it to work yesterday with the script below, but when I tried to utilize the same script for other anchors, it broke completely. Even after I took the additional anchors out, the original still doesn't work anymore. I'm very new to javascript so the answer may be something obvious--I've been thinking it might have to do with calling or invoking the function in the script? But that's just a guess. Thank you in advance to anyone who can help! Here is the html for the link: <a href="/projects#stripmall"><p><b>Strip Mall Magazi

Pool hard cap violation? on react native image

16 January 2026 @ 6:08 am

How to fix this issue? Currently getting Pool hard cap violation?. Some answers suggest to add "android/app/src/main/AndroidManifest.xml" <application android:largeHeap="true" Is there any other solution for this? Instead of changing Heap Size.

Registering Multiple IAP products

16 January 2026 @ 6:06 am

I just learned today that Google Play removed import/export of CSV file anymore. I have at least 80 IAP Products to register for the game that I am working with. Is there a better and faster way to do it aside from registering it one by one?

Forever waiting for CompletableFuture$Signaller in shutdown hook

16 January 2026 @ 6:02 am

A method receives ProcessHandle toBeKilledProcessHandle and then kills that process normally. Note that this is normal termination of the process so that the shutdown hook gets invoked in that process. boolean terminated = toBeKilledProcessHandle.destroy(); Although the return value terminated is true, that process doesn't get killed actually. That process can be found by ps -ef. Thread dump of that process has the following portion: "Thread-3" #29 [1963] prio=5 os_prio=0 cpu=6.63ms elapsed=1524.97s tid=0x000070e474005da0 nid=1963 waiting on condition [0x000070e603c05000] java.lang.Thread.State: WAITING (parking) at jdk.internal.misc.Unsafe.park([email protected]/Native Method) - parking to wait for <0x00000000ff714278> (a java.util.concurrent.CompletableFuture$Signaller) at java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:221) at java.util.concu

Getting 401 Unauthorized with Vite environment variables - Keys visible in console but API calls fail

16 January 2026 @ 5:54 am

I'm working with Vite and trying to use API keys from my .env file. I'm experiencing a strange issue where the keys appear correctly in console.log(), but my API requests are failing with 401 Unauthorized errors. .env file: env VITE_UNSPLASH_KEY=my_actual_key VITE_PEXELS_KEY=my_actual_key VITE_GIPHY_KEY=my_actual_key JavaScript code: javascript import axios from "axios"; const UNSPLASH_KEY = import.meta.env.VITE_UNSPLASH_KEY; const PEXELS_KEY = import.meta.env.VITE_PEXELS_KEY; const GIPHY_KEY = import.meta.env.VITE_GIPHY_KEY; console.log(GIPHY_KEY); // Prints the key correctly in console export async function fetchgif(query, page = 1, per_page = 20) { const res = await axios.get(`https://api.giphy.com/v1/gifs/search`, { params: { api_key: GIPHY_KEY, q: query, limit: per_page, offset: (page - 1) * per_page, }, }

how to rectify javax.jms.JMSException: Failed to create connection?

16 January 2026 @ 5:50 am

We are(multiple JAVA applications) connecting to IBM MQ using the JMS / JNDI approach in a WebSphere Application Server environment. Each request follows the below high-level flow: Create a JNDI InitialContext using com.ibm.websphere.naming.WsnInitialContextFactory Look up the JMS ConnectionFactory via JNDI (for example: jms/ABCD) Look up the request queue and reply queue using JNDI Create a JMS Connection from the ConnectionFactory Create a non-transacted JMS Session with AUTO_ACKNOWLEDGE Start the connection Create a MessageProducer Construct and send the MQ request message (CIH format) Close all JMS and JNDI resources in the finally

XDG base dir spec: What to do if $HOME is also not set?

16 January 2026 @ 5:38 am

In the XDG base dir specification it is advised that if e.g. $XDG_STATE_HOME is not set, the application should fall back to $HOME/.local/state . But it says nothing about what happens if $HOME is not set. In this case what happens? Should I check if $HOME is set in my application and if not error out? Or just let the application crash? Or should I, in case its not set, fall back further to ~/.local/state ?

What's the best bot mitigation tool out there today?

16 January 2026 @ 5:16 am

I have a friend being slammed with traffic. It appears mostly from China. But the weird thing is that most traffic doesn't even spend time on the page. Can someone recommend a tool which will help me see what's really going on here?

How can I enforce server-side step completion before allowing access to a route in Next.js?

16 January 2026 @ 3:40 am

I’m building a Next.js application where users must complete a required step (for example, identity verification or a comprehension step) before being allowed to access certain protected routes. The key requirement is that this enforcement must be server-side and non-bypassable. Client-side guards alone (such as checking React state or redirecting in useEffect) are insufficient, because a user can bypass them by manipulating the client or navigating directly to the route. What I’ve tried Client-side route guards using React state and redirects Checking completion flags in the browser before rendering the page These approaches work for basic UX but do not provide real enforcement, since the route can still be accessed if the client is tampered with or navigated directly. What I’m trying to achieve I want the server to be authoritative over route access. If the required step has not