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

adds a react example project #4

Merged
merged 2 commits into from
Nov 21, 2022
Merged

adds a react example project #4

merged 2 commits into from
Nov 21, 2022

Conversation

nhayfield
Copy link
Collaborator

Adds react example project.
Also a test using the audience and issuer. (Express example only tests with wrong audience and issuer).

fixes: https://github.com/pomerium/pomerium-console/issues/2795

export { verifyPomeriumJWT, parseJWT, getClientJwt, getJWKsData } from './utils';
export { PomeriumVerifier } from './verifier';
export { verifyPomeriumJWT, parseJWT, getClientJwt, getJWKsData } from './utils.js';
export { PomeriumVerifier } from './verifier.js';
Copy link
Collaborator Author

@nhayfield nhayfield Nov 18, 2022

Choose a reason for hiding this comment

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

i had to add the file extensions here for it to work with default create react app.
it looks like we ejected our webpack in pomerium-console to fix this issue and it is a common problem that people have with webpack and esm modules.
I don't see a way to generate with the file extensions automatically with tsc.
not sure if we need to add them or not either.

in console we have:
resolve: { fullySpecified: false // disable the behaviour }
in our webpack config.overrides.js

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

apparently there is like a holy war about it: microsoft/TypeScript#40878

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

so tldr you have to put
import { something } from 'somewhere.js';
in your .ts files even though those files don't exist.
pretty weird but it works.

@nhayfield nhayfield merged commit 521f97b into main Nov 21, 2022
@nhayfield nhayfield deleted the addReactExample branch November 22, 2022 17:11
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