public User getUser() {
        User pageUser = null;
        try {
            final AuthToken authToken = getAuthToken();
            if (authToken == null)
            {
                Log.debug( "Unable to get user: no session or no auth token on session." );
                return null;
            }
            if (authToken instanceof AuthToken.OneTimeAuthToken) {
                return new User(authToken.getUsername(), "Recovery via One Time Auth Token", null, new Date(), new Date());
            }
            final String username = authToken.getUsername();
            if (username == null || username.isEmpty())
            {
                Log.debug( "Unable to get user: no username in auth token on session." );
                return null;
            }
            pageUser = getUserManager().getUser(username);
        }
        catch (Exception ex) {
            Log.debug("Unexpected exception (which is ignored) while trying to obtain user.", ex);
        }
        return pageUser;
    }
@return the page user or {@code null} if one is not found.
xmppserver/src/main/java/org/jivesoftware/util/WebManager.java