Setu-TS
    Preparing search index...

    Type Alias SessionStamp

    SessionStamp: (principal: IPrincipal) => string | null | Promise<string | null>

    Reads a user's current session stamp. The application keeps the stamp on its user record — a sessionVersion counter, or a prefix of the password hash — and changes it to end every session that user holds.

    IAuthSessionService.signIn records a SHA-256 digest of the value; every request compares the digest of the current value with it in constant time. A different value, a throw, or anything other than a string or null makes the request anonymous. null means the user has no stamp, and matches only a session recorded with none.

    Called with the principal the request resolved — the session snapshot, or what RefreshPrincipal returned — so a refreshPrincipal that loads the user can put the stamp in a claim and this callback can read it back without a second load.

    Type Declaration

      • (principal: IPrincipal): string | null | Promise<string | null>
      • Parameters

        Returns string | null | Promise<string | null>

    0.11.0