diff --git a/app/Application.js b/app/Application.js
index 1be9f4e6..f7e18a44 100644
--- a/app/Application.js
+++ b/app/Application.js
@@ -30,9 +30,6 @@ Ext.define('Rambox.Application', {
ga_storage._setAccount('UA-80680424-1');
ga_storage._trackPageview('/index.html', 'main');
- // Initialize Auth0
- Rambox.ux.Auth0.init();
-
// Add shortcuts to switch services using CTRL + Number
var map = new Ext.util.KeyMap({
target: document
diff --git a/app/ux/Auth0.js b/app/ux/Auth0.js
index e7f40ce5..e1c12b9b 100644
--- a/app/ux/Auth0.js
+++ b/app/ux/Auth0.js
@@ -113,7 +113,7 @@ Ext.define('Rambox.ux.Auth0', {
} else {
Ext.Msg.confirm('Clear services', 'Do you want to remove all your current services to start over?
If NO, you will be logged out.', function(btnId) {
if ( btnId === 'yes' ) {
- me.removeAllServices(false);
+ Ext.cq1('app-main').getController().removeAllServices(false);
} else {
me.logout();
}
@@ -124,7 +124,7 @@ Ext.define('Rambox.ux.Auth0', {
} else if ( snapshot2.hasChildren() && Ext.getStore('Services').getCount() > 0 ) {
Ext.Msg.confirm('Confirm', 'To import your configuration, I need to remove all your current services. Do you want to continue?
If NO, you will be logged out.', function(btnId) {
if ( btnId === 'yes' ) {
- me.removeAllServices(false, function() {
+ Ext.cq1('app-main').getController().removeAllServices(false, function() {
importServices(snapshot2);
});
} else {
@@ -164,6 +164,8 @@ Ext.define('Rambox.ux.Auth0', {
,login: function() {
var me = this;
+ if ( !me.auth0 ) Rambox.ux.Auth0.init();
+
me.lock.show();
}