From 3d6727ff4c001d28e014be826cac739b8ebf8923 Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Mon, 17 Jul 2017 10:28:32 +0100 Subject: [PATCH] Fixes issue with auth login redirect failure --- app/app/routes/application.js | 2 +- app/app/utils/net.js | 10 ++++++++-- core/api/endpoint/server.go | 2 +- core/api/request/init.go | 2 -- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/app/routes/application.js b/app/app/routes/application.js index 1f7c0636..9322b7cb 100644 --- a/app/app/routes/application.js +++ b/app/app/routes/application.js @@ -45,7 +45,7 @@ export default Ember.Route.extend(ApplicationRouteMixin, TooltipMixin, { if (is.not.include(next, '/auth/')) { window.location.href= next; - } + } } }, diff --git a/app/app/utils/net.js b/app/app/utils/net.js index 8bac8ccf..e6919edd 100644 --- a/app/app/utils/net.js +++ b/app/app/utils/net.js @@ -40,14 +40,20 @@ function getAppUrl(domain) { } function isAjaxAccessError(reason) { - if (typeof reason === "undefined" || typeof reason.errors === "undefined") { + if (typeof reason === "undefined") { return false; } - if (reason.errors.length > 0 && (reason.errors[0].status === "401" || reason.errors[0].status === "403")) { + if (reason.message === 'Ajax authorization failed') { return true; } + if (typeof reason.errors === "undefined") { + if (reason.errors.length > 0 && (reason.errors[0].status === "401" || reason.errors[0].status === "403")) { + return true; + } + } + return false; } diff --git a/core/api/endpoint/server.go b/core/api/endpoint/server.go index d94619df..b80096e8 100644 --- a/core/api/endpoint/server.go +++ b/core/api/endpoint/server.go @@ -35,7 +35,7 @@ var Product core.ProdInfo func init() { Product.Major = "1" Product.Minor = "49" - Product.Patch = "0" + Product.Patch = "1" Product.Version = fmt.Sprintf("%s.%s.%s", Product.Major, Product.Minor, Product.Patch) Product.Edition = "Community" Product.Title = fmt.Sprintf("%s Edition", Product.Edition) diff --git a/core/api/request/init.go b/core/api/request/init.go index 2a950206..e49287df 100644 --- a/core/api/request/init.go +++ b/core/api/request/init.go @@ -83,8 +83,6 @@ func init() { } } - fmt.Println(Db.DriverName()) - return false // value not changed }) }