-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
Description
The method signatures on the AuthenticationClient seem a bit conflicting to me: The methods both return the AuthenticationResponse as well as feeding that value to the AuthenticationStateHandler before returning. Typically, when passing in a handler such as this, I'd expect the method to be asynchronous and to return void.
What I'd propose is to restructure it a bit so a) the methods do not take the handler and b) the case logic lives in the handler or a separate class.
AuthenticationStateHandler handler = createMyHandler();
AuthenticationResponse response = client.authenticate(user, pass, relayState);
handler.handle(response);
// or response.process(handler); or something elsePerhaps there's a reason for this approach, but I didn't find one in the commit history. If there's a better place to have this discussion, please feel free to redirect me and close this.