Skip to content

Commit df59516

Browse files
theHackermarcusdacoregio
authored andcommitted
Fix Kotlin example in authorize-http-requests.adoc
- Consistency: Replaced mix of tabs/spaces with spaces indentation
1 parent 9744cc4 commit df59516

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

docs/modules/ROOT/pages/servlet/authorization/authorize-http-requests.adoc

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,15 @@ Java::
185185
[source,java,role="primary"]
186186
----
187187
@Bean
188-
SecurityFilterChain web(HttpSecurity http) throws Exception {
189-
http
190-
.authorizeHttpRequests((authorize) -> authorize
191-
.requestMatchers("/endpoint").hasAuthority("USER")
192-
.anyRequest().authenticated()
193-
)
188+
public SecurityFilterChain web(HttpSecurity http) throws Exception {
189+
http
190+
.authorizeHttpRequests((authorize) -> authorize
191+
.requestMatchers("/endpoint").hasAuthority("USER")
192+
.anyRequest().authenticated()
193+
)
194194
// ...
195-
196-
return http.build();
195+
196+
return http.build();
197197
}
198198
----
199199
@@ -202,14 +202,15 @@ Kotlin::
202202
[source,kotlin,role="secondary"]
203203
----
204204
@Bean
205-
SecurityFilterChain web(HttpSecurity http) throws Exception {
206-
http {
205+
fun web(http: HttpSecurity): SecurityFilterChain {
206+
http {
207207
authorizeHttpRequests {
208208
authorize("/endpoint", hasAuthority("USER"))
209209
authorize(anyRequest, authenticated)
210210
}
211-
}
212-
return http.build();
211+
}
212+
213+
return http.build()
213214
}
214215
----
215216

0 commit comments

Comments
 (0)