or! status: ${response.status}`);
            }

            let data = await response.json();
            data.publicKey.user.id = base64UrlDecode(data.publicKey.user.id);
            data.publicKey.challenge = base64UrlDecode(data.publicKey.challenge)

            credentials = await navigator.credentials.create(data);
            let credentialsForServer = {
                id: credentials.id,
                type: credentials.type,
                rawId: base64UrlEncode(credentials.rawId),
             