Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-boot-admin
Commits
6eff7914
Commit
6eff7914
authored
Jan 23, 2018
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add handling for 401 on XHR responses.
parent
4c56589a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
8 deletions
+37
-8
pom.xml
...ot-admin-samples/spring-boot-admin-sample-servlet/pom.xml
+14
-0
SpringBootAdminApplication.java
...de/codecentric/boot/admin/SpringBootAdminApplication.java
+6
-2
package-lock.json
spring-boot-admin-server-ui/package-lock.json
+0
-0
package.json
spring-boot-admin-server-ui/package.json
+3
-4
index.js
spring-boot-admin-server-ui/src/main/frontend/index.js
+12
-0
login.html
spring-boot-admin-server-ui/src/main/frontend/login.html
+1
-1
index.vue
...t-admin-server-ui/src/main/frontend/views/about/index.vue
+1
-1
No files found.
spring-boot-admin-samples/spring-boot-admin-sample-servlet/pom.xml
View file @
6eff7914
...
...
@@ -46,6 +46,20 @@
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-starter-client
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.session
</groupId>
<artifactId>
spring-session-core
</artifactId>
<version>
2.0.0.RELEASE
</version>
</dependency>
<dependency>
<groupId>
org.springframework.session
</groupId>
<artifactId>
spring-session-jdbc
</artifactId>
<version>
2.0.0.RELEASE
</version>
</dependency>
<dependency>
<groupId>
org.hsqldb
</groupId>
<artifactId>
hsqldb
</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
spring-boot-admin-samples/spring-boot-admin-sample-servlet/src/main/java/de/codecentric/boot/admin/SpringBootAdminApplication.java
View file @
6eff7914
...
...
@@ -31,6 +31,7 @@ import org.springframework.context.annotation.Profile;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
import
org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler
;
@Configuration
@EnableAutoConfiguration
...
...
@@ -56,16 +57,19 @@ public class SpringBootAdminApplication {
@Override
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
// @formatter:off
SavedRequestAwareAuthenticationSuccessHandler
successHandler
=
new
SavedRequestAwareAuthenticationSuccessHandler
();
successHandler
.
setTargetUrlParameter
(
"redirectTo"
);
http
.
authorizeRequests
()
.
antMatchers
(
"/assets/**"
).
permitAll
()
.
antMatchers
(
"/login"
).
permitAll
()
.
anyRequest
().
authenticated
()
.
and
()
.
formLogin
().
loginPage
(
"/login"
).
and
()
.
formLogin
().
loginPage
(
"/login"
).
successHandler
(
successHandler
).
and
()
.
logout
().
and
()
.
httpBasic
().
and
()
.
csrf
().
disable
();
// @formatter:on
// @formatter:on
}
}
...
...
spring-boot-admin-server-ui/package-lock.json
View file @
6eff7914
This source diff could not be displayed because it is too large. You can
view the blob
instead.
spring-boot-admin-server-ui/package.json
View file @
6eff7914
...
...
@@ -51,7 +51,7 @@
"css-hot-loader"
:
"^1.3.5"
,
"css-loader"
:
"^0.28.9"
,
"css-mqpacker"
:
"^6.0.1"
,
"eslint"
:
"^4.1
5
.0"
,
"eslint"
:
"^4.1
6
.0"
,
"eslint-plugin-html"
:
"^4.0.1"
,
"eslint-plugin-vue-libs"
:
"^2.1.0"
,
"extract-text-webpack-plugin"
:
"^3.0.2"
,
...
...
@@ -60,7 +60,7 @@
"html-loader"
:
"^0.5.5"
,
"html-webpack-plugin"
:
"^2.30.0"
,
"identity-obj-proxy"
:
"^3.0.0"
,
"jest"
:
"^22.1.
3
"
,
"jest"
:
"^22.1.
4
"
,
"jest-vue"
:
"^0.8.2"
,
"lodash-webpack-plugin"
:
"^0.11.4"
,
"node-sass"
:
"^4.7.2"
,
...
...
@@ -73,8 +73,7 @@
"vue-svg-loader"
:
"^0.4.0"
,
"vue-template-compiler"
:
"^2.5.13"
,
"webpack"
:
"^3.10.0"
,
"webpack-bundle-analyzer"
:
"^2.9.2"
,
"webpack-dev-server"
:
"^2.11.0"
"webpack-bundle-analyzer"
:
"^2.9.2"
},
"browserslist"
:
[
"> 2%"
,
...
...
spring-boot-admin-server-ui/src/main/frontend/index.js
View file @
6eff7914
...
...
@@ -14,6 +14,7 @@
* limitations under the License.
*/
import
axios
from
'axios'
;
import
moment
from
'moment'
;
import
Vue
from
'vue'
;
import
VueRouter
from
'vue-router'
;
...
...
@@ -38,6 +39,17 @@ const router = new VueRouter({
});
Notifications
.
requestPermissions
();
axios
.
interceptors
.
request
.
use
(
config
=>
{
config
.
headers
[
'X-Requested-With'
]
=
'XMLHttpRequest'
;
return
config
;
});
axios
.
interceptors
.
response
.
use
(
response
=>
response
,
error
=>
{
if
(
401
===
error
.
response
.
status
)
{
window
.
location
=
`login?redirectTo=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
;
}
return
Promise
.
reject
(
error
);
});
const
store
=
new
Store
();
...
...
spring-boot-admin-server-ui/src/main/frontend/login.html
View file @
6eff7914
...
...
@@ -33,7 +33,7 @@
<div
class=
"column is-4 is-offset-4"
>
<div
class=
"box"
>
<h1
class=
"title"
>
Spring Boot Admin
</h1>
<form
method=
"post"
action=
"login"
>
<form
method=
"post"
>
<div
class=
"field"
>
<p
class=
"is-medium has-text-danger"
th:unless=
"${param.error == null}"
>
Invalid username or password!
...
...
spring-boot-admin-server-ui/src/main/frontend/views/about/index.vue
View file @
6eff7914
...
...
@@ -56,7 +56,7 @@
<font-awesome-icon
size=
"lg"
:icon=
"['fab', 'gitter']"
></font-awesome-icon>
Gitter
</a>
</div>
</div>
<h1
class=
"title is-5"
>
Trademarks and License
</h1>
<h1
class=
"title is-5"
>
Trademarks and License
s
</h1>
<div
class=
"content"
>
<p>
The source code of Spring Boot Admin is licensed under
<a
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment