Skip to content

Fix documentation code block bug. #12980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ There are convenience mechanisms to make this easier, but this is still not inte
.Java
[source,java,role="primary",attrs="-attributes"]
----
User user = User.withDefaultPasswordEncoder()
UserDetails user = User.withDefaultPasswordEncoder()
.username("user")
.password("password")
.roles("user")
Expand Down Expand Up @@ -243,12 +243,12 @@ If you are creating multiple users, you can also reuse the builder:
[source,java,role="primary"]
----
UserBuilder users = User.withDefaultPasswordEncoder();
User user = users
UserDetails user = users
.username("user")
.password("password")
.roles("USER")
.build();
User admin = users
UserDetails admin = users
.username("admin")
.password("password")
.roles("USER","ADMIN")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ Authentication authentication = this.authenticationManager.authenticate(token);
// ...
SecurityContext context = SecurityContextHolder.createEmptyContext(); <1>
context.setAuthentication(authentication); <2>
SecurityContextHolder.setContext(authentication); <3>
SecurityContextHolder.setContext(context); <3>
----
====

Expand Down