Actually use the loginUser arguments in the example

This commit is contained in:
Romain Rigaux 2021-02-11 18:36:54 -08:00 committed by GitHub
parent 19655edbf7
commit fb6c8a63e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -453,7 +453,7 @@ For example, using the "Django REST framework JWT" package
function loginUser(username, password) { function loginUser(username, password) {
let action = ["api-token-auth", "obtain-token"]; let action = ["api-token-auth", "obtain-token"];
let params = {username: "example", email: "example@example.com"}; let params = {username: username, password: password};
client.action(schema, action, params).then(function(result) { client.action(schema, action, params).then(function(result) {
// On success, instantiate an authenticated client. // On success, instantiate an authenticated client.
let auth = window.coreapi.auth.TokenAuthentication({ let auth = window.coreapi.auth.TokenAuthentication({