powr-sdk-web 1.9.5 → 1.9.6

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.
@@ -26,6 +26,7 @@ var baseUrl = 'https://api.powrbase.cloud';
26
26
  var PowrLogin = function PowrLogin(_ref) {
27
27
  var onLogin = _ref.onLogin,
28
28
  onRegister = _ref.onRegister,
29
+ onLoginSuccess = _ref.onLoginSuccess,
29
30
  _ref$loginApiUrl = _ref.loginApiUrl,
30
31
  loginApiUrl = _ref$loginApiUrl === void 0 ? "".concat(baseUrl, "/auth/login") : _ref$loginApiUrl,
31
32
  _ref$registerApiUrl = _ref.registerApiUrl,
@@ -169,8 +170,12 @@ var PowrLogin = function PowrLogin(_ref) {
169
170
  });
170
171
  if (response.ok) {
171
172
  setSuccess(isLogin ? 'Login successful!' : 'Registration successful!');
172
- if (isLogin && onLogin) {
173
- onLogin(data);
173
+ if (isLogin) {
174
+ if (onLoginSuccess) {
175
+ onLoginSuccess(data);
176
+ } else if (onLogin) {
177
+ onLogin(data);
178
+ }
174
179
  } else if (!isLogin && onRegister) {
175
180
  onRegister(data);
176
181
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powr-sdk-web",
3
- "version": "1.9.5",
3
+ "version": "1.9.6",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "build": "babel src -d dist --copy-files",