mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-05-15 10:55:31 -04:00
Make create passkey param passing work (#520)
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user