Make create passkey param passing work (#520)

This commit is contained in:
Leendert de Borst
2025-09-30 16:25:19 +02:00
parent 3c91103c3a
commit 536c020bfb
2 changed files with 5 additions and 4 deletions

View File

@@ -29,7 +29,7 @@ const PasskeyAuthenticate: React.FC = () => {
const [loading, setLoading] = useState(false);
useEffect(() => {
// Get the request data from hash
// Get the request data from hash (format: #/passkeys/authenticate?request=...)
const hash = location.hash.substring(1); // Remove '#'
const params = new URLSearchParams(hash.split('?')[1] || '');
const requestData = params.get('request');

View File

@@ -25,9 +25,9 @@ const PasskeyCreate: React.FC = () => {
const [loading, setLoading] = useState(false);
useEffect(() => {
// Get the request data from hash
const hash = location.hash.substring(1); // Remove '#'
const params = new URLSearchParams(hash.split('?')[1] || '');
console.log(location);
// Get the request data from hash (format: #/passkeys/create?request=...)
const params = new URLSearchParams(location.search);
const requestData = params.get('request');
console.log('PasskeyCreate: useEffect: requestData', requestData);
@@ -36,6 +36,7 @@ const PasskeyCreate: React.FC = () => {
try {
const parsed = JSON.parse(decodeURIComponent(requestData));
setRequest(parsed);
console.log('Parsed request data:', parsed);
if (parsed.publicKey?.user?.displayName) {
setDisplayName(parsed.publicKey.user.displayName);