@grow-codes/oidc - v0.1.2
    Preparing search index...

    Function extractRoles

    • Extracts role names from the claim at rolesClaim (default roles).

      • a string → split on commas and whitespace ("admin editor", "admin,editor");
      • an array of strings and/or objects → each string, or the object's name (Casdoor), code, role or value;
      • anything else (missing, number, object) → [].

      Duplicates are removed; order is kept.

      Parameters

      • claims: Readonly<Record<string, unknown>>
      • rolesClaim: string = "roles"

      Returns string[]