cordova-plugin-unvired-universal-sdk 1.0.4 → 1.0.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.
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/src/browser/UnviredPluginProxy.js +1 -1
- package/www/authenticationService.ts +16 -11
- package/www/kernel.js +9 -4
package/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="cordova-plugin-unvired-universal-sdk" version="1.0.
|
|
2
|
+
<plugin id="cordova-plugin-unvired-universal-sdk" version="1.0.6" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
3
|
<name>UnviredSDK</name>
|
|
4
4
|
<dependency id="cordova-plugin-device" version="^3.0.0" />
|
|
5
5
|
<dependency id="cordova-plugin-unvired-electron-db" version="0.0.14" />
|
|
@@ -403,7 +403,8 @@ export class AuthenticationService {
|
|
|
403
403
|
return;
|
|
404
404
|
}
|
|
405
405
|
} else {
|
|
406
|
-
|
|
406
|
+
// The Browser check is commented out for SAML2 login type.Because it should always call the activate rest api.
|
|
407
|
+
// if (FrameworkHelper.getPlatform() !== "browser") {
|
|
407
408
|
// Call activate rest api
|
|
408
409
|
const activationResponse = await HttpConnection.activateUser(loginParameters);
|
|
409
410
|
|
|
@@ -412,6 +413,7 @@ export class AuthenticationService {
|
|
|
412
413
|
if (activationResponse.status === Status.created) {
|
|
413
414
|
frameworkSettings = activationResponseObject;
|
|
414
415
|
loginParameters.frontendId = frameworkSettings[ServiceConstants.KeySettings]["frontendId"];
|
|
416
|
+
loginParameters.feUserId = frameworkSettings[ServiceConstants.KeySettings]["feUser"];
|
|
415
417
|
loginParameters.activationId = frameworkSettings[ServiceConstants.KeySettings]["activationId"];
|
|
416
418
|
const unviredId = UserSettingsFields[UserSettingsFields.unviredId];
|
|
417
419
|
userSettings[unviredId] = loginParameters.username;
|
|
@@ -431,16 +433,19 @@ export class AuthenticationService {
|
|
|
431
433
|
resolve(unviredResult);
|
|
432
434
|
return;
|
|
433
435
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}
|
|
436
|
+
|
|
437
|
+
// } else {
|
|
438
|
+
// const unviredId = UserSettingsFields[UserSettingsFields.unviredId];
|
|
439
|
+
// userSettings[unviredId] = loginParameters.username;
|
|
440
|
+
// const unviredUserId = UserSettingsFields[UserSettingsFields.unviredUserId];
|
|
441
|
+
// userSettings[unviredUserId] = frameworkSettings[unviredId];
|
|
442
|
+
// const unviredPwd = UserSettingsFields[UserSettingsFields.unviredPassword];
|
|
443
|
+
// userSettings[unviredPwd] = FrameworkHelper.getMD5String(loginParameters.password);
|
|
444
|
+
// // added this to save the settings in the DB
|
|
445
|
+
// frameworkSettings = {"settings": frameworkSettings}
|
|
446
|
+
// }
|
|
447
|
+
|
|
448
|
+
|
|
444
449
|
// NOTE: This is not required as the jwt token is already available in the loginParameters.
|
|
445
450
|
// // Get jwt token from rest api
|
|
446
451
|
// const jwtResponse = await HttpConnection.getJwtToken(loginParameters);
|
package/www/kernel.js
CHANGED
|
@@ -373,7 +373,7 @@ UMP.prototype.userSettings = async function (success, fail) {
|
|
|
373
373
|
const unviredPassword = await UserSettingsManager.getInstance().getFieldValue(UserSettingsFields.unviredPassword);
|
|
374
374
|
const userSettings = {
|
|
375
375
|
"UNVIRED_ID": unviredUserId,
|
|
376
|
-
"USER_ID": AuthenticationService.loginParameters.username,
|
|
376
|
+
"USER_ID": AuthenticationService.loginParameters.username || unviredUserId,
|
|
377
377
|
"FULL_NAME": "",
|
|
378
378
|
"EMAIL": "",
|
|
379
379
|
"SERVER_URL": AuthenticationService.loginParameters.url,
|
|
@@ -438,10 +438,14 @@ UMP.prototype.clearData = async function (success, fail) {
|
|
|
438
438
|
/**
|
|
439
439
|
* Check for Internet connection
|
|
440
440
|
*/
|
|
441
|
-
UMP.prototype.hasInternet = function (success, fail) {
|
|
441
|
+
UMP.prototype.hasInternet = async function (success, fail) {
|
|
442
442
|
try {
|
|
443
443
|
// TODO: Implement this SettingsPlugin
|
|
444
|
-
|
|
444
|
+
if (!(await isServerReachable(AuthenticationService.instance.loginParameters.url))) {
|
|
445
|
+
success(false)
|
|
446
|
+
} else {
|
|
447
|
+
success(true)
|
|
448
|
+
}
|
|
445
449
|
} catch (error) {
|
|
446
450
|
fail(error)
|
|
447
451
|
}
|
|
@@ -693,9 +697,10 @@ UMP.prototype.dbEndTransaction = async function () {
|
|
|
693
697
|
/**
|
|
694
698
|
* dbSaveWebData - Save Web Database
|
|
695
699
|
*/
|
|
696
|
-
UMP.prototype.dbSaveWebData = function (success, fail) {
|
|
700
|
+
UMP.prototype.dbSaveWebData = async function (success, fail) {
|
|
697
701
|
try {
|
|
698
702
|
// TODO: Implement this SettingsPlugin
|
|
703
|
+
await DatabaseManager.getInstance().saveWebData();
|
|
699
704
|
success(true)
|
|
700
705
|
} catch (error) {
|
|
701
706
|
fail(error)
|