Skip to content
This repository was archived by the owner on Oct 5, 2020. It is now read-only.

Commit 74cf3ee

Browse files
committed
Fixed #493: login intercept should not logout at fail
1 parent b58166d commit 74cf3ee

File tree

4 files changed

+29
-43
lines changed

4 files changed

+29
-43
lines changed

README.mdown

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ On Mac or Linux:
6262
npm install
6363
bower install
6464
gulp init-local
65-
./ml local bootstrap
66-
./ml local deploy modules
67-
./ml local deploy content
65+
./ml local install
6866
./ml local mlcp -options_file import-sample-data.options
6967

7068
On Windows:
@@ -73,9 +71,7 @@ On Windows:
7371
npm install
7472
bower install
7573
gulp init-local
76-
ml.bat local bootstrap
77-
ml.bat local deploy modules
78-
ml.bat local deploy content
74+
ml.bat local install
7975
ml.bat local mlcp -options_file import-sample-data.options
8076

8177
## Prepare your Application

app/templates/README.mdown

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,15 @@ On Mac or Linux:
3232
npm install
3333
bower install
3434
gulp init-local
35-
./ml local bootstrap
36-
./ml local deploy modules
37-
./ml local deploy content
35+
./ml local install
3836
./ml local mlcp -options_file import-sample-data.options
3937

4038
On Windows:
4139

4240
npm install
4341
bower install
4442
gulp init-local
45-
ml.bat local bootstrap
46-
ml.bat local deploy modules
47-
ml.bat local deploy content
43+
ml.bat local install
4844
ml.bat local mlcp -options_file import-sample-data.options
4945

5046
## Prepare your Application

app/templates/ui/app/error/errorInterceptor.service.js

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,32 @@
1414
responseError: function(rejection) {
1515
var msg;
1616
var toastMsg;
17-
if (rejection.status === 500 || rejection.status === 400) {
18-
var messageBoardService = $injector.get('messageBoardService');
19-
if (rejection.data && rejection.data.errorResponse) {
20-
msg = {
21-
title: rejection.data.errorResponse.status,
22-
body: rejection.data.errorResponse.message
23-
};
24-
} else {
25-
msg = {
26-
title: (rejection.status === 400) ? 'Bad Request' : 'Internal Server Error',
27-
body: ''
28-
};
17+
if (rejection.data && rejection.data.errorResponse) {
18+
msg = {
19+
title: rejection.data.errorResponse.status,
20+
body: rejection.data.errorResponse.message
21+
};
22+
} else {
23+
msg = {
24+
title: (rejection.status === 401) ? 'Unauthorised' : (
25+
(rejection.status >= 400 && rejection.status < 500) ? 'Bad Request' :
26+
'Internal Server Error'
27+
),
28+
body: ''
29+
};
30+
}
31+
toastMsg = '<strong>' + msg.title + '</strong><p>' + msg.body + '</p>';
32+
toast.create({
33+
className: 'danger',
34+
content: toastMsg,
35+
dismissOnTimeout: true,
36+
timeout: 2000,
37+
onDismiss: function () {
2938
}
39+
});
40+
if (rejection.status >= 400 && rejection.status !== 401) {
41+
var messageBoardService = $injector.get('messageBoardService');
3042
messageBoardService.message(msg);
31-
toastMsg = '<strong>' + msg.title + '</strong><p>' + msg.body + '</p>';
32-
toast.danger(toastMsg);
33-
} else if (rejection.status === 401) {
34-
if (rejection.data && rejection.data.errorResponse) {
35-
msg = {
36-
title: rejection.data.errorResponse.status,
37-
body: rejection.data.errorResponse.message
38-
};
39-
} else {
40-
msg = {
41-
title: (rejection.status === 401) ? 'Unauthorised' : 'Internal Server Error',
42-
body: ''
43-
};
44-
}
45-
toastMsg = '<strong>' + msg.title + '</strong><p>' + msg.body + '</p>';
46-
var loginService = $injector.get('loginService');
47-
loginService.logout();
48-
toast.danger(toastMsg);
4943
}
5044
return $q.reject(rejection);
5145
}

app/themes/dashboard/ui/app/dashboard/content-box.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
return {
99
restrict: 'E',
1010
transclude: true,
11-
replace: false,
11+
replace: true,
1212
scope: {
1313
boxTitle: '@',
1414
boxBordered: '@',

0 commit comments

Comments
 (0)