I got this working using Authentication Code Flow with PKCE by:
Reading the code hash from the URL
code
Calling msalInstance.acquireTokenByCode with
msalInstance.acquireTokenByCode