@frontegg/ionic-capacitor 1.0.0-alpha.3 → 1.0.0
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/README.md +11 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -356,6 +356,17 @@ import { FronteggService } from '@frontegg/ionic-capacitor';
|
|
|
356
356
|
this.fronteggService.$isAuthenticated.subscribe(async () => {
|
|
357
357
|
window.location.reload()
|
|
358
358
|
});
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Listens to application visibility changes
|
|
362
|
+
* Reload the page to trigger canActivate
|
|
363
|
+
* when application returns from login page without authentication
|
|
364
|
+
*/
|
|
365
|
+
document.addEventListener('visibilitychange', () => {
|
|
366
|
+
if (document.visibilityState === 'visible' && !this.fronteggService.getState().isAuthenticated) {
|
|
367
|
+
window.location.reload()
|
|
368
|
+
}
|
|
369
|
+
});
|
|
359
370
|
}
|
|
360
371
|
|
|
361
372
|
/**
|