@explorins/pers-signer 1.0.11 → 1.0.12

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.
@@ -1901,8 +1901,17 @@ class PersSignerSDK {
1901
1901
  */
1902
1902
  async combinedAuthentication(identifier, persAccessToken) {
1903
1903
  try {
1904
- // Authenticate with DFNS only (we already have PERS token)
1905
- const signerAuthToken = await this.loginUser(identifier);
1904
+ // Authenticate with DFNS - try login first, register if user doesn't exist
1905
+ let signerAuthToken;
1906
+ try {
1907
+ signerAuthToken = await this.loginUser(identifier);
1908
+ }
1909
+ catch (loginError) {
1910
+ console.log(`[PersSignerSDK] User not found, registering new user: ${identifier}`);
1911
+ // User doesn't exist - register new user (registerUser already includes login)
1912
+ const registrationResult = await this.registerUser(identifier);
1913
+ signerAuthToken = registrationResult.authToken;
1914
+ }
1906
1915
  return {
1907
1916
  identifier,
1908
1917
  signerAuthToken,