Bug found in WPMU DEV Dashboard - Unable to logout

WPMU DEV Dashboard plugin, version 4.0.7

The plugin is unable to logout from an already synced WPMUDEV account. It just keeps logged in even after deactivating, deleting, reinstalling and activating the plugin again. I am proposing a fix at the bottom of this post.

This is a video of the bug: https://www.youtube.com/watch?v=jkO_ed_lONc

And this is what happens technically:

1 - When pushing the log out button, it redirects to the dashboard page, with a GET variable set in the URL "clear_key=1"
2 - The server processes the request: in the WPMUDEV_Dashboard_Api class constructor, it checks if we have the clear_key GET variable and if so, it doesn't load the api key from the database, so the api_key remains as an empty string.
3 - Then, when reaching render_dashboard() in the WPMUDEV_Dashboard_Ui class, as the clear_key GET variable is set, it calls the WPMUDEV_Dashboard_Site->logout, which simply returns false because we don't have an api key set.
4- The render_dashboard() method in WPMUDEV_Dashboard_Ui continues running and renders the login page, without logging out the user, so, in the next request, the user will be logged in "magically".

I fixed it by taking into account the clear_key GET variable when evaluating if we need to clear the key from the database or not... so, in the WPMUDEV_Dashboard_Site class logout function, I replaced this:

// Prevent infinite loops...
if ( ! WPMUDEV_Dashboard::$api->has_key()) { return false; }

With this:

// Prevent infinite loops...
if ( ! WPMUDEV_Dashboard::$api->has_key() && empty( $_GET['clear_key'] )) { return false; }

And everything is working fine now =). I would make a pull request or something if I just had access to the developer repositories.