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
login Response when user not found #351
Comments
That shouldn't happen. If a user does not exist, the Could you post your |
Here it is:
|
Could you also paste the database part? |
Also have this. I have admin panel and app views on the same project, so I want to check if user trying to log in on my admin panel is superuser and not a simple user:
|
Ok, so the problem comes from this Actually, you don't need to implement this yourself. You can use the |
@frankie567 I already try that one... "get_current_superuser"...but it gives me 401 unauthorized every time I try to login...does this function check if you are sending a token ?...cause since I try to login there is no token yet on the request. |
Yes, you have to be authenticated with a token/cookie to be authorized. The flow is this:
|
Ok now I get it. So following the flow you give me and applying it to my case. A simple user could send log in credentials into my admin panel and get his token although he is not superadmin, since my two user type share the same table on db. |
Exactly! You have only one login endpoint, for every users. If the user has the In your frontend app, you can use the |
I send the login params and if the user is not found on db, the app just raise an internal console exception with this message:
tortoise.exceptions.DoesNotExist: Object does not exist
I have a frontend interface running on different port...so when I try to see the response from the login request, there is no message on browser console, just error 500, with no description. Is there a way of add one ?
The text was updated successfully, but these errors were encountered: