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

[API] Auth login error #9211

Closed
SchrodingersGat opened this issue Mar 1, 2025 · 2 comments · Fixed by #9212
Closed

[API] Auth login error #9211

SchrodingersGat opened this issue Mar 1, 2025 · 2 comments · Fixed by #9212
Assignees
Labels
api Relates to the API bug Identifies a bug which needs to be addressed
Milestone

Comments

@SchrodingersGat
Copy link
Member

SchrodingersGat commented Mar 1, 2025

This error was caught on sentry.io

A GET request to /api/user/token/ resulted in a 500 status, and threw the following errors:

ValueError: You have multiple authentication backends configured and therefore must provide the `backend` argument or set the `backend` attribute on the user.
AttributeError: 'User' object has no attribute 'backend'

The trace points to this line of code:

login(request, user)

@SchrodingersGat SchrodingersGat added api Relates to the API bug Identifies a bug which needs to be addressed security Relates to a security issue labels Mar 1, 2025
@SchrodingersGat SchrodingersGat added this to the 1.0.0 milestone Mar 1, 2025
@SchrodingersGat
Copy link
Member Author

@matmair I am assuming this is related to the recent auth API refactor - can you please take a look?

@matmair
Copy link
Member

matmair commented Mar 1, 2025

I have an idea for a quick fix but the clean solution would be to remove the calls to /token completely - we do not need them for the frontend anymore.

Is there any more context provided in sentry? I can not reproduce this reliably in my dev environment.

@matmair matmair removed the security Relates to a security issue label Mar 1, 2025
matmair added a commit to matmair/InvenTree that referenced this issue Mar 1, 2025
SchrodingersGat pushed a commit that referenced this issue Mar 1, 2025
simonkuehling pushed a commit to simonkuehling/InvenTree that referenced this issue Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Relates to the API bug Identifies a bug which needs to be addressed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants