docs: function(hash){
      var params = {},
          regex = /([^&=]+)=([^&]*)/g,
          m;
  
      while ((m = regex.exec(hash)) !== null) {
        params[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
      }
  
      // OpenID Connect
      if (params.id_token && !params.error) {
        IdToken.validateTokensAndPopulateClaims(params);
        return params;
      }
  
      // Oauth2
      if(params.access_token || params.error){
        return params;
      }
    }