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

[Feature] Authenticate requests from POS UI extensions #1961

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

lizkenyon
Copy link
Contributor

WHY are these changes introduced?

Fixes # 756

WHAT is this pull request doing?

  • Adds new method to authenticate requests for POS UI extensions
  • POS UI extensions follow the same authentication method as Checkout UI extensions

https://github.com/user-attachments/assets/12a46342-0b22-4931-bbf9-c41f10ec31ef
https://github.com/user-attachments/assets/bc509672-8076-48aa-95c7-49a39b72bc79

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have used pnpm changeset to create a draft changelog entry (do NOT update the CHANGELOG.md files manually)
  • I have added/updated tests for this change
  • I have documented new APIs/updated the documentation for modified APIs (for public APIs)

@lizkenyon lizkenyon requested a review from a team as a code owner January 13, 2025 22:15
Copy link
Contributor

@sle-c sle-c left a comment

Choose a reason for hiding this comment

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

this looks the same as checkout extension auth as you mentioned

@lizkenyon lizkenyon merged commit 66cac34 into main Jan 23, 2025
7 checks passed
@lizkenyon lizkenyon deleted the liz/pos-extension-auth branch January 23, 2025 17:51
@blanklob
Copy link

blanklob commented Feb 6, 2025

Hey @lizkenyon why I should have to specify the url in fetch if I run dev command I will have to update it every time ? Instead can we push a or to pos extensions for a native hook?

@lizkenyon
Copy link
Contributor Author

@blanklob

Thanks this is definitely an experience we want to improve. For both POS and checkout UI extensions. Thank you for your feedback.

In the mean time you may want to look into using a static tunnel URL with the --tunnel-url flag with the CLI

@bifo90
Copy link

bifo90 commented Feb 10, 2025

@lizkenyon

Hi Liz, this looks so cool! The only thing I'm missing is into my backend route /pos: if I hit a POST request into it, my console doesn't ring a bell, Insomnia does it instead. I'm a little struggling into it, I can see correcly my Session Token, but nothing seems to work.

The code is exactly the same as yours, surely I'm missing something.

Wish I could receive some kind of help or hint from anyone :)

@lizkenyon
Copy link
Contributor Author

Hi @bifo90

Sounds like there may be something wrong with your routing, or how your URL is setup in your extension. I would double check your URL in your extension file!

Otherwise please feel free to create a new issue with code to reproduce.

@bifo90
Copy link

bifo90 commented Feb 10, 2025

@lizkenyon

Sure! I'll double check everything. Seems strange but I always got this strange error from the backend: "Load failed", sounds nothing to you?

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.

4 participants