@calimero-network/mero-react 10.0.0 → 10.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -855,7 +855,6 @@ function AccountSignInPanel({
855
855
  );
856
856
  }
857
857
  var DEVICE_KEY = "calimero.device";
858
- var STATE_KEY = "calimero.enrol.state";
859
858
  var HOSTED_WALLET = "https://wallet.cloud.calimero.network/account-enroll";
860
859
  var hex = (b) => [...new Uint8Array(b)].map((x) => x.toString(16).padStart(2, "0")).join("");
861
860
  function executorOf(relay) {
@@ -961,28 +960,10 @@ function useAccountEnrolment({
961
960
  (async () => {
962
961
  try {
963
962
  const keys = await deviceKeys();
964
- const sent = (() => {
965
- try {
966
- return sessionStorage.getItem(STATE_KEY);
967
- } catch {
968
- return null;
969
- }
970
- })();
971
- try {
972
- sessionStorage.removeItem(STATE_KEY);
973
- } catch {
974
- }
975
- if (!sent) {
976
- setNote(
977
- 'This enrolment could not be verified as one this tab started, so it was not accepted. Start again from "Enrol with your account".'
978
- );
979
- return;
980
- }
981
963
  const enrolled = await meroJs.completeDeviceEnrolment({
982
964
  ...back,
983
965
  devicePublicKey: keys.signPk,
984
- kemPublicKey: keys.kemPk,
985
- expectState: sent
966
+ kemPublicKey: keys.kemPk
986
967
  });
987
968
  meroJs.saveDelegatedCredential({
988
969
  account: enrolled.account,
@@ -1021,18 +1002,12 @@ function useAccountEnrolment({
1021
1002
  setNote(e instanceof Error ? e.message : String(e));
1022
1003
  return;
1023
1004
  }
1024
- const state = hex(crypto.getRandomValues(new Uint8Array(16)));
1025
- try {
1026
- sessionStorage.setItem(STATE_KEY, state);
1027
- } catch {
1028
- }
1029
1005
  window.location.assign(
1030
1006
  meroJs.deviceEnrolmentUrl({
1031
1007
  walletUrl,
1032
1008
  devicePublicKey: keys.signPk,
1033
1009
  kemPublicKey: keys.kemPk,
1034
- returnTo: window.location.origin + window.location.pathname,
1035
- state
1010
+ returnTo: window.location.origin + window.location.pathname
1036
1011
  })
1037
1012
  );
1038
1013
  }, [walletUrl]);