Skip to content

Commit

Permalink
Fix Kotlin example in authorize-http-requests.adoc
Browse files Browse the repository at this point in the history
- Consistency: Replaced mix of tabs/spaces with spaces indentation
  • Loading branch information
theHacker authored and marcusdacoregio committed May 23, 2024
1 parent 9744cc4 commit df59516
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ Java::
[source,java,role="primary"]
----
@Bean
SecurityFilterChain web(HttpSecurity http) throws Exception {
http
.authorizeHttpRequests((authorize) -> authorize
.requestMatchers("/endpoint").hasAuthority("USER")
.anyRequest().authenticated()
)
public SecurityFilterChain web(HttpSecurity http) throws Exception {
http
.authorizeHttpRequests((authorize) -> authorize
.requestMatchers("/endpoint").hasAuthority("USER")
.anyRequest().authenticated()
)
// ...
return http.build();
return http.build();
}
----
Expand All @@ -202,14 +202,15 @@ Kotlin::
[source,kotlin,role="secondary"]
----
@Bean
SecurityFilterChain web(HttpSecurity http) throws Exception {
http {
fun web(http: HttpSecurity): SecurityFilterChain {
http {
authorizeHttpRequests {
authorize("/endpoint", hasAuthority("USER"))
authorize(anyRequest, authenticated)
}
}
return http.build();
}
return http.build()
}
----
Expand Down

0 comments on commit df59516

Please sign in to comment.