Skip to content
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

get current user in plugins #1724

Open
mlaripour opened this issue Jun 12, 2022 · 2 comments
Open

get current user in plugins #1724

mlaripour opened this issue Jun 12, 2022 · 2 comments
Labels
enhancement New feature or request needs more info Requires more information from poster

Comments

@mlaripour
Copy link

Is your feature request related to a problem? Please describe.

get current user name with <http.auth.get(request)> function dose not work

Describe the solution you'd like

change <this.authState.set(req, state)> in src.core.http.http_server.ts .

@mlaripour mlaripour added the enhancement New feature or request label Jun 12, 2022
@kavilla kavilla linked a pull request Jun 14, 2022 that will close this issue
7 tasks
@kavilla kavilla self-assigned this Jun 14, 2022
@kavilla kavilla added needs more info Requires more information from poster and removed untriaged labels Jun 14, 2022
@ashwin-pc
Copy link
Member

Hey @mlaripour. Can we have a little more information about this issue? More precisely, why is req.auth.artifacts the right thing to store in http.auth.

Looking into the registerAuth function, it appears that state is actually returned by fn: AuthenticationHandler. If the AuthenticationHandler that you are using does not return an object with the state property, http.auth.get(request) will return undefined. Replacing state in this.authState.set will only fix your specific use case. Other users who return the state object in fn will have a broken experience.

I'm not too familiar with this section of code, but from a quick glance at it, it looks like we will need a bit more information before making a change here since this a core feature. Let me know if you have tried using an AuthenticationHandler that returns the state object as expected.

@seanneumann
Copy link
Contributor

@ahopp Needs triage. What are next steps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs more info Requires more information from poster
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants