@seaverse/auth-sdk 0.3.1 → 0.3.2

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
@@ -3438,12 +3438,12 @@ class AuthModal {
3438
3438
  this.showSuccess('Login Successful', 'Welcome back!');
3439
3439
  }
3440
3440
  else {
3441
- throw new Error('Invalid response from server');
3441
+ throw new Error(response?.error || 'Invalid response from server');
3442
3442
  }
3443
3443
  }
3444
3444
  catch (error) {
3445
- // Handle error
3446
- const errorMessage = error instanceof Error ? error.message : 'Login failed';
3445
+ // Handle error - 优先使用服务器返回的 error 字段
3446
+ const errorMessage = error || 'Invalid response from server';
3447
3447
  this.showError('Login Failed', errorMessage);
3448
3448
  if (this.options.onError) {
3449
3449
  this.options.onError(error);