@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.js CHANGED
@@ -3415,12 +3415,12 @@ class AuthModal {
3415
3415
  this.showSuccess('Login Successful', 'Welcome back!');
3416
3416
  }
3417
3417
  else {
3418
- throw new Error('Invalid response from server');
3418
+ throw new Error(response?.error || 'Invalid response from server');
3419
3419
  }
3420
3420
  }
3421
3421
  catch (error) {
3422
- // Handle error
3423
- const errorMessage = error instanceof Error ? error.message : 'Login failed';
3422
+ // Handle error - 优先使用服务器返回的 error 字段
3423
+ const errorMessage = error || 'Invalid response from server';
3424
3424
  this.showError('Login Failed', errorMessage);
3425
3425
  if (this.options.onError) {
3426
3426
  this.options.onError(error);