Skip to content

Validate a hash is legit when it links to its own page #2183

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

Merged
merged 2 commits into from
Apr 14, 2025

Conversation

NWylynko
Copy link
Contributor

What does this solve?

The validation script expects all the links to be both a path, then possibly a hash (eg /docs/quickstart#login) but sometimes a link only has a hash (eg #login) pointing to another point on the page, so we need to validate those links. Currently the script just skips over those links

What changed?

Added tests with links that only use a hash, then fixed the script, to pull in its own doc to validate against.

Checklist

  • I have clicked on "Files changed" and performed a thorough self-review
  • All existing checks pass

@NWylynko NWylynko requested a review from a team as a code owner April 14, 2025 19:59
Copy link

Hey, here’s your docs preview: https://clerk.com/docs/pr/2183

@NWylynko
Copy link
Contributor Author

New warnings yay!

docs/account-portal/disable-account-portal.mdx
13:97-13:182  warning Hash "customizing-your-sign-upsign-in-flow" not found in /docs/account-portal/disable-account-portal

docs/authentication/social-connections/linkedin-oidc.mdx
52:227-52:277 warning Hash "get-your-client-id-and-client-secret" not found in /docs/authentication/social-connections/linkedin-oidc

docs/backend-requests/resources/session-tokens.mdx
50:26-50:67   warning Hash "session-claims" not found in /docs/backend-requests/resources/session-tokens

docs/components/authentication/sign-up.mdx
224:7-224:38  warning Hash "sign-up-props" not found in /docs/components/authentication/sign-up
302:7-302:38  warning Hash "sign-up-props" not found in /docs/components/authentication/sign-up

docs/custom-flows/email-links.mdx
22:3-22:65    warning Hash "email-address-verification-flow" not found in /docs/custom-flows/email-links

docs/deployments/changing-domains.mdx
19:6-19:67    warning Hash "updating-your-publishable-key" not found in /docs/deployments/changing-domains

docs/references/backend/types/auth-object.mdx
86:5-86:42    warning Hash "server-get-token" not found in /docs/references/backend/types/auth-object

docs/references/chrome-extension/configure-consistent-crx-id.mdx
61:79-61:129  warning Hash "configure-a-crx-id-for-a-new-extension" not found in /docs/references/chrome-extension/configure-consistent-crx-id

docs/references/javascript/sign-up.mdx
11:16-11:45   warning Hash "verification" not found in /docs/references/javascript/sign-up

docs/references/javascript/types/role.mdx
38:11-38:53   warning Hash "permission-resource" not found in /docs/references/javascript/types/role

docs/references/nextjs/basic-rbac.mdx
69:365-69:444 warning Hash "create-a-global-typescript-definition" not found in /docs/references/nextjs/basic-rbac

docs/references/nextjs/waitlist.mdx
110:5-110:77  warning Hash "add-clerkmiddleware-to-your-app" not found in /docs/references/nextjs/waitlist

docs/testing/playwright/test-authenticated-flows.mdx
71:45-71:77   warning Hash "-in-the-config" not found in /docs/testing/playwright/test-authenticated-flows
71:90-71:124  warning Hash "-in-a-test-file" not found in /docs/testing/playwright/test-authenticated-flows

docs/testing/playwright/test-helpers.mdx
38:5-38:75    warning Hash "set-up-clerk-testing-token-options" not found in /docs/testing/playwright/test-helpers
40:54-40:124  warning Hash "set-up-clerk-testing-token-options" not found in /docs/testing/playwright/test-helpers

docs/users/user-impersonation.mdx
43:167-43:192 warning Hash "jwt-claims" not found in /docs/users/user-impersonation

⚠ 18 warnings

@NWylynko NWylynko requested a review from alexisintech April 14, 2025 20:01
Copy link
Member

@alexisintech alexisintech left a comment

Choose a reason for hiding this comment

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

awesome ! thanks so much 🫶

@NWylynko NWylynko merged commit 39c71cc into main Apr 14, 2025
7 checks passed
@NWylynko NWylynko deleted the nick/validate-self-linked-docs branch April 14, 2025 21:10
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