File tree 3 files changed +3
-66
lines changed
assets/src/main/java/io/leafage/basic/assets
3 files changed +3
-66
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 21
21
import org .springframework .context .annotation .Configuration ;
22
22
import org .springframework .data .domain .ReactiveAuditorAware ;
23
23
import org .springframework .data .r2dbc .config .EnableR2dbcAuditing ;
24
+ import org .springframework .security .core .Authentication ;
24
25
import org .springframework .security .core .context .SecurityContext ;
25
26
import org .springframework .security .core .context .SecurityContextHolder ;
26
- import org .springframework .security .core .userdetails .User ;
27
27
import reactor .core .publisher .Mono ;
28
28
29
29
/**
@@ -44,7 +44,7 @@ public class AuditConfiguration {
44
44
public ReactiveAuditorAware <String > auditorProvider () {
45
45
return () -> Mono .defer (() -> Mono .justOrEmpty (SecurityContextHolder .getContext ()))
46
46
.map (SecurityContext ::getAuthentication )
47
- .filter (auth -> auth != null && auth . isAuthenticated () && auth . getPrincipal () instanceof User )
48
- .map (auth -> (( User ) auth . getPrincipal ()). getUsername () );
47
+ .filter (Authentication :: isAuthenticated )
48
+ .map (Authentication :: getName );
49
49
}
50
50
}
You can’t perform that action at this time.
0 commit comments