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

docs: fix code error for API protection with node(express) #541

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

xiaohanyu
Copy link
Contributor

Summary

Just fix some simple code error for API protection docs with node(express).

Note

The code

    throw new Error({ code: 'auth.authorization_header_missing', status: 401 });

will result in a typescript warning:

image

From what I can see in the core repo, the code has been improved and get rid of the TypeScript error.

Not sure whether you guys would fix this typescript warning in docs code snippet.

@xiaohanyu xiaohanyu force-pushed the docs/fix-code-error-for-node branch from 6af00c3 to ce72854 Compare December 13, 2023 13:41
@xiaohanyu
Copy link
Contributor Author

@wangsijie please help review

Copy link
Contributor

@wangsijie wangsijie left a comment

Choose a reason for hiding this comment

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

This PR only extracts 'Bearer' to a constant?

@xiaohanyu
Copy link
Contributor Author

This PR only extracts 'Bearer' to a constant?

yes.

For the typescript warnings, I am not sure whether you guys are aware of this or have other better ideas, so this part is not in the PR.

@wangsijie wangsijie force-pushed the docs/fix-code-error-for-node branch from ce72854 to 31b4a27 Compare December 22, 2023 03:24
@wangsijie wangsijie merged commit 4f7546a into logto-io:master Dec 22, 2023
3 checks passed
@xiaohanyu xiaohanyu deleted the docs/fix-code-error-for-node branch December 24, 2023 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants