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

modify SessionToken to be compatible with Checkout UI Extension #329

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

jeroendelau
Copy link
Contributor

Checkout UI Extensions have session tokens, but they vary slightly from the token provided by Shopify Apps.

App Session Tokens
Checkout Extension Session Tokens

Key differences:

  • iss, sid are not part of the token
  • sub, optional
  • dest: has no protocol prefix

By merging this PR people should be able to use session tokens obtained through useSessionToken, to interact with the back-end without modification.

@jeroendelau jeroendelau changed the title modify SessionToken to work with from Checkout UI Extension modify SessionToken to be compatible with Checkout UI Extension Jul 24, 2024
@jeroendelau jeroendelau force-pushed the app-extension-support branch from 9b59acd to 99bc6cd Compare July 24, 2024 09:16
@jeroendelau jeroendelau marked this pull request as ready for review July 24, 2024 09:16
@Kyon147
Copy link
Owner

Kyon147 commented Aug 2, 2024

@jeroendelau are you able to add a wiki page on how this would be use for the checkout extension vs the main laravel application?

@jeroendelau
Copy link
Contributor Author

absolutely, I will try to get something in there before the end of the week.

@Kyon147
Copy link
Owner

Kyon147 commented Sep 5, 2024

@jeroendelau great work on this.
Just checking on this, do you need anything from me to get this passed with the check "linting" and then we can get it merged in

@jeroendelau
Copy link
Contributor Author

No, sorry, simply had no time. Will fix

@jeroendelau
Copy link
Contributor Author

I think I fixed all linter issues, but I'm having trouble reproducing the same error locally.
Added a wiki page here: https://github.com/Kyon147/laravel-shopify/wiki/Working-with-App-Extensions

@jeroendelau
Copy link
Contributor Author

jeroendelau commented Sep 12, 2024

Added in separate PR #346

The reason I couldn't get the linter to fail was because the local version does not match the version of github actions.

github action 3.0.0
composer ^3.0 (which results in 3.59.3).

After setting composer to 3.0.0 the errors matched.

Suggest adjusting the lint action to use the composer version so mismatch can't happen.

name: PHP Lint

on: [ push, pull_request ]

jobs:
  lint:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.2'
          coverage: none

      - name: Get Composer cache directory
        id: cache-composer
        run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

      - name: Restore Composer cache
        uses: actions/cache@v3
        with:
          path: ${{ steps.cache-composer.outputs.dir }}
          key: ${{ runner.os }}-${{ github.ref_name }}-composer-${{ hashFiles('**/composer.lock') }}

      - name: Install Composer dependencies
        run: |
          composer install --no-interaction --prefer-dist

      - name: Check for code style violation with PHP-CS-Fixer
        run: vendor/bin/php-cs-fixer fix --diff

Copy link
Owner

@Kyon147 Kyon147 left a comment

Choose a reason for hiding this comment

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

Looks great

@Kyon147 Kyon147 merged commit 1cc5029 into Kyon147:master Sep 24, 2024
6 checks passed
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