I am building a "classic" web application with Quarkus with server-side template rendering and form-auth login. I am using quarkus-resteasy-reactive, quarkus-security-jpa, quarkus-resteasy-reactive-qute. It all works fine so far, but I want to the use the current user object in the templates without injecting the SecurityContext into every route and pass it to every template. I noticed there is a concept of GlobalVariables, but they are all static and not aware of the context. In other words: One would be the best way in Quarkus to inject a common context into Qute templates? Thanks!
Asked
Active
Viewed 60 times
0
-
You might want to look at Quarkus Renarde: https://quarkiverse.github.io/quarkiverse-docs/quarkus-renarde/dev/index.html#_security – Serkan May 05 '23 at 20:32
-
Thanks! That looks very interesting. I took a close look into the code of Renarde and I noticed my problem seems to solved and I could inject the user object into the tmeplates with inject:user. However, I am very much interested in learning Quarkus and could not find a named Bean "user". How and where is this Bean generated? – fabian.kirstein May 14 '23 at 08:20
-
Renarde does that. Read the page about ‘Security’. – Serkan May 16 '23 at 06:37
-
I know, that it does that. I am interested in the "how". How does it do it? Where is the Bean generated. I screened the entire code, but could not figure it out myself. But I am not a DI expert. – fabian.kirstein May 16 '23 at 14:59