Skip to content

Commit 54de5c9

Browse files
1993heqiangrwinch
authored andcommitted
Fix documentation code block bug.
Closes gh-12980
1 parent 64a1ad5 commit 54de5c9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/modules/ROOT/pages/features/authentication/password-storage.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ There are convenience mechanisms to make this easier, but this is still not inte
213213
.Java
214214
[source,java,role="primary",attrs="-attributes"]
215215
----
216-
User user = User.withDefaultPasswordEncoder()
216+
UserDetails user = User.withDefaultPasswordEncoder()
217217
.username("user")
218218
.password("password")
219219
.roles("user")
@@ -243,12 +243,12 @@ If you are creating multiple users, you can also reuse the builder:
243243
[source,java,role="primary"]
244244
----
245245
UserBuilder users = User.withDefaultPasswordEncoder();
246-
User user = users
246+
UserDetails user = users
247247
.username("user")
248248
.password("password")
249249
.roles("USER")
250250
.build();
251-
User admin = users
251+
UserDetails admin = users
252252
.username("admin")
253253
.password("password")
254254
.roles("USER","ADMIN")

docs/modules/ROOT/pages/servlet/authentication/session-management.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ Authentication authentication = this.authenticationManager.authenticate(token);
820820
// ...
821821
SecurityContext context = SecurityContextHolder.createEmptyContext(); <1>
822822
context.setAuthentication(authentication); <2>
823-
SecurityContextHolder.setContext(authentication); <3>
823+
SecurityContextHolder.setContext(context); <3>
824824
----
825825
====
826826

0 commit comments

Comments
 (0)