FusionAuth/fusionauth-netcore-client

The "global" parameter does not work when logging out

EPRenaud opened this issue ยท 4 comments

Howdy ๐Ÿ‘‹

When I try to logout a user with the logout method, I receive an HTTP 400 error when I pass the global parameter.

This code returns an HTTP 200 as expected

await _client.LogoutAsync(null, token);

This code returns an HTTP 400

await _client.LogoutAsync(true, token);

The details of the error is

message: Invalid
code: [couldNotConvert]global

Hmmm. @EPRenaud does await _client.LogoutAsync(false, token); give you a 400 or a 200?

Hi @mooreds, sorry for the delay.
await _client.LogoutAsync(false, token); gives me an HTTP 400 as well.

I think I know the cause of this. Because global is bool?, the call to withParameter is using the overload that takes object rather than the bool one.

public IRESTClient withParameter(string name, object value) {
if (value == null) {
return this;
}
return withParameter(name, value.ToString());
}

The output of bool.ToString() is True or False rather than true or false, and presumably the server is expecting the latter.

Thanks @epbensimpson, I created a PR to fix this ๐Ÿ˜‰