Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

I have found a bug that passing username "0" and password "0" successfully receives a token #33

Closed
ghost opened this issue Sep 14, 2014 · 5 comments
Labels

Comments

@ghost
Copy link

ghost commented Sep 14, 2014

Even though there is no user with username "0" in the system.

@ghost
Copy link
Author

ghost commented Sep 14, 2014

I am using the /api-token-auth/ endpoint as follows:

    var data = {};
    data['username'] = username;
    data['password'] = password;

    session.set('error', '');

    /* Sign in */
    $.post(session.url_signin, data, null, 'json').then(
        function(response){

...

@jpadilla jpadilla added the bug label Sep 14, 2014
@jpadilla
Copy link
Owner

Hey @bbalban thanks for reporting this. It would help if you could write a test that shows this behaviour.

jpadilla added a commit that referenced this issue Sep 14, 2014
@jpadilla
Copy link
Owner

@bbalban added a test to try and reproduce, but got all tests passing. Check it out to see if I'm correctly reproducing it.

@ghost
Copy link
Author

ghost commented Sep 15, 2014

Hi @jpadilla also tried: curl -X POST -H "Content-Type: application/json" -d '{"username":"0","password":"0"}' http://127.0.0.1:8000/api-token-auth/ to make sure it is not my javascript and still getting a token. I'll try your test next. It could be something wrong with my setup but will see.

@ghost
Copy link
Author

ghost commented Sep 17, 2014

Sorry for the false alarm. It seemed to be wrong since I had no user with ID 0 reported by DRF, though it turns out I had a user with username 0.

@ghost ghost closed this as completed Sep 17, 2014
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant