title: Auth0 react-sdk accessing role information
body: <p>Auth0 returns role information in an object with the following shape:</p>
  <pre><code>{
    &quot;http://tap/roles&quot;: [
      &quot;DistrictUser&quot;
    ],
    &quot;given_name&quot;: &quot;Bob&quot;
  }
  </code></pre>
  <p>I can check role membership as follows:</p>
  <pre><code>  const { user } = useAuth0()
    const roles = Object.values(user)[0]
    const hasRole = (role) =&gt; {
      if (roles.includes(role)) {
        return true
      }
    }
  
    console.log(hasRole('DistrictUser'))
  </code></pre>
  <p>This returns <code>true</code> if the user belongs to the 'DistrictUser' role. This method works, but it is convoluted. It also assumes roles will always be in the first position of the user object.</p>
  <p>Is there a way to natively check for roles in the SDK? I've been unable to find one.</p>