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

refactor: v2 origin check error message #15143

Merged
merged 2 commits into from
May 21, 2024

Conversation

supalarry
Copy link
Contributor

Example app fails because of incorrect origin error. The browser appends example app URL as the "origin" header, but it is not set as redirect uri in the OAuth client, so the requests fail.

Screenshot 2024-05-21 at 11 03 28 Screenshot 2024-05-21 at 11 03 34

Purpose of the PR is to improve error message in such case to be more helpful.

@graphite-app graphite-app bot requested a review from a team May 21, 2024 09:11
Copy link
Contributor

github-actions bot commented May 21, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@keithwillcode keithwillcode added core area: core, team members only platform Anything related to our platform plan labels May 21, 2024
@dosubot dosubot bot added api area: API, enterprise API, access token, OAuth authentication area: authentication, auth, google sign in, password, SAML, password reset, can't log in 💻 refactor labels May 21, 2024
@graphite-app graphite-app bot requested a review from a team May 21, 2024 09:11
@supalarry supalarry enabled auto-merge (squash) May 21, 2024 09:11
Copy link

vercel bot commented May 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ai ⬜️ Ignored (Inspect) Visit Preview May 21, 2024 2:08pm
cal ⬜️ Ignored (Inspect) Visit Preview May 21, 2024 2:08pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview May 21, 2024 2:08pm

Copy link

graphite-app bot commented May 21, 2024

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (05/21/24)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add platform team as reviewer" took an action on this PR • (05/21/24)

1 reviewer was added to this PR based on Keith Williams's automation.

Copy link
Contributor

github-actions bot commented May 21, 2024

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link

deploysentinel bot commented May 21, 2024

Current Playwright Test Results Summary

✅ 6 Passing - ⚠️ 4 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 05/21/2024 03:06:03pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: a055787

Started: 05/21/2024 03:05:00pm UTC

⚠️ Flakes

📄   packages/embeds/embed-core/playwright/tests/namespacing.e2e.ts • 4 Flakes

Top 1 Common Error Messages

null

4 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Namespacing Inline Embed Double install Embed Snippet with inline embed using a namespace
Retry 1Initial Attempt
0.43% (1) 1 / 232 run
failed over last 7 days
61.64% (143) 143 / 232 runs
flaked over last 7 days
Namespacing Inline Embed Add inline embed using a namespace without reload
Retry 1Initial Attempt
0% (0) 0 / 232 runs
failed over last 7 days
63.79% (148) 148 / 232 runs
flaked over last 7 days
Namespacing Inline Embed Double install Embed Snippet with inline embed without a namespace(i.e. default namespace)
Retry 1Initial Attempt
0% (0) 0 / 232 runs
failed over last 7 days
64.66% (150) 150 / 232 runs
flaked over last 7 days
Namespacing Different namespaces can have different init configs
Retry 1Initial Attempt
0% (0) 0 / 231 runs
failed over last 7 days
61.47% (142) 142 / 231 runs
flaked over last 7 days

View Detailed Build Results


Copy link
Contributor

@p6l-richard p6l-richard left a comment

Choose a reason for hiding this comment

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

This is definitely an improvement, nice!
I think it's fine to be helpful to the user with a very descriptive and information-rich error message, given that this part of the code is behind an auth check, so we've already validated the user's access rights (& therefore we trust the user and want to be as helpful as possible).

Right? @supalarry & @ThyMinimalDev

--

For posterity, this could be improved even further with e.g.:

  • add a section https://cal.com/docs/platform/oauthclient to our docs with a breadcrumb sublink to /platform/oauthclient#redirecturis to explain (1) this required to make platform work in a browser environment (or certain requests will fail) & (2) why we're doing this check
  • Add a /platform/errors section to our docs (possibly auto-generated from the nextjs app/swagger?)
  • Update the error message to point to the docs

@supalarry supalarry merged commit c3638eb into main May 21, 2024
40 checks passed
@supalarry supalarry deleted the refactor-origin-check-error-message branch May 21, 2024 15:35
p6l-richard pushed a commit to p6l-richard/cal.com-fork that referenced this pull request Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api area: API, enterprise API, access token, OAuth authentication area: authentication, auth, google sign in, password, SAML, password reset, can't log in core area: core, team members only platform Anything related to our platform plan 💻 refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants