Passing Echo.Context into Templ's Render functon #2669
Unanswered
notpolyglot
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Did you find a solution? @notpolyglot |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
this is my render function
i have already tried using c.Request().Context(), however templ doesnt detect the values set by echo.
i am passing a user object, and a "loggedin" variable into the component context so that i can display a Login button or a user avatar button on my navbar.
it looks like this
then in a middleware i want to check if the user is logged in, and set it in the context
how can i pass the echo context into the templ render function so that i can access the the "loggedIn" value set in the CheckUser middleware.
And also while im asking this question. is this the best way to add a conditional render of a login or avatar button?
Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions