Skip to content

Conversation

@dirkwa
Copy link
Contributor

@dirkwa dirkwa commented Jan 22, 2026

Improve type safety in OIDC module

Summary

  • Replace [key: string]: any with [key: string]: unknown in SecurityConfigForOIDC interface
  • Fix potential undefined access in decodeIdToken function

Details

Stricter index signature typing (oidc-admin.ts)

Changed the index signature from any to unknown, which enforces proper type checking when accessing dynamic properties. This eliminates the need for the eslint-disable comment and aligns with TypeScript strict mode best practices.

Safer array access (user-info.ts)

The decodeIdToken function now explicitly checks that the payload part exists before using it. While the length check already ensures 3 parts, TypeScript's strict mode requires this additional guard since array index access can return undefined. This makes the code more robust and satisfies strict null checks.

- Replace [key: string]: any with [key: string]: unknown
- Fix potential undefined access in decodeIdToken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant