Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(oidc-auth): Fixed type error #936

Merged
merged 1 commit into from
Jan 17, 2025
Merged

Conversation

hnw
Copy link
Contributor

@hnw hnw commented Jan 16, 2025

Summary

While running the oidc-oauth test, I encountered the following error. Therefore, I have fixed it.

The test worked in other environments, so I suspect that the issue was caused by the esbuild version update.

    src/index.ts:152:7 - error TS2322: Type 'JWTPayload' is not assignable to type 'Partial<OidcAuth>'.
      'string' index signatures are incompatible.
        Type 'unknown' is not assignable to type 'JsonValue | undefined'.

    152       auth = await verify(session_jwt, env.OIDC_AUTH_SECRET)
              ~~~~
    src/index.ts:248:69 - error TS2345: Argument of type '{} | null' is not assignable to parameter of type 'string'.
      Type 'null' is not assignable to type 'string'.

    248         const response = await oauth2.revocationRequest(as, client, auth.rtk)
                                                                            ~~~~~~~~

Changes

  • Fixed type error

Tasks

  • Add tests
  • Run tests
  • yarn changeset at the top of this repo and push the changeset
  • Follow the contribution guide

Copy link

changeset-bot bot commented Jan 16, 2025

🦋 Changeset detected

Latest commit: ff40629

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hono/oidc-auth Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@hnw hnw changed the title Fixed type error fix(oidc-auth): Fixed type error Jan 16, 2025
Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe
Copy link
Member

@hnw

Thank you. It's not better if the CI can't throw the type error but, it's okay to merge it now.

@yusukebe yusukebe merged commit be34f69 into honojs:main Jan 17, 2025
1 check passed
@github-actions github-actions bot mentioned this pull request Jan 17, 2025
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.

2 participants