Test that oauth tokens are actually usable after issuing
This commit is contained in:
@@ -1263,7 +1263,14 @@ describe('OAuth2', function () {
|
|||||||
expect(body.access_token).to.be.a('string');
|
expect(body.access_token).to.be.a('string');
|
||||||
expect(body.token_type).to.eql('Bearer');
|
expect(body.token_type).to.eql('Bearer');
|
||||||
|
|
||||||
done();
|
// Ensure the token is also usable
|
||||||
|
superagent.get(SERVER_URL + '/api/v1/profile?access_token=' + body.access_token, function (error, result) {
|
||||||
|
expect(error).to.not.be.ok();
|
||||||
|
expect(result.status).to.eql(200);
|
||||||
|
expect(result.body.username).to.equal(USER_0.username);
|
||||||
|
|
||||||
|
done();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user