Shopify / koa-shopify-auth

DEPRECATED Middleware to authenticate a Koa application with Shopify
MIT License
80 stars 63 forks source link

Stuck on /auth?shop= with Redis CustomSessionStorage #142

Closed fwidyadri closed 2 years ago

fwidyadri commented 2 years ago

Issue summary

I implemented the Redis CustomSessionStorage following the example in JS instead of TS. I am running Redis on Docker.

Expected behavior

The dev shop should be able to install and access the app.

Actual behavior

The app is halted during redirect to /auth?shop={} then throw 503 error.

Screenshot 2022-01-28 at 08 54 24

I can see the storeCallback is being called and the session is stored to the Redis server with value of

Session {
  id: 'b5fd1664-9638-4d6c-a025-f545268b9480',
  shop: '{shopname}.myshopify.com',
  state: '844071846893356',
  isOnline: true
}

Here is my package.json

"dependencies": {
    "@babel/core": "7.12.10",
    "@babel/polyfill": "^7.6.0",
    "@babel/preset-env": "^7.12.11",
    "@babel/register": "^7.12.10",
    "@shopify/app-bridge-react": "^2.0.7",
    "@shopify/app-bridge-utils": "^2.0.7",
    "@shopify/koa-shopify-auth": "^4.1.4",
    "@shopify/koa-shopify-webhooks": "^4.3.0",
    "@shopify/polaris": "^6.2.0",
    "apollo-boost": "^0.4.9",
    "cross-env": "^7.0.3",
    "dotenv": "^8.2.0",
    "graphql": "^14.5.8",
    "isomorphic-fetch": "^3.0.0",
    "koa": "^2.13.1",
    "koa-router": "^10.0.0",
    "koa-session": "^6.1.0",
    "next": "^10.0.4",
    "next-env": "^1.1.0",
    "node-fetch": "^2.6.1",
    "react": "^16.10.1",
    "react-apollo": "^3.1.3",
    "react-dom": "^16.10.1",
    "redis": "^4.0.2",
    "store-js": "^2.0.4",
    "webpack": "^4.44.1"
  },
  "devDependencies": {
    "@babel/plugin-proposal-class-properties": "^7.2.3",
    "@babel/plugin-transform-runtime": "^7.12.10",
    "@babel/preset-stage-3": "^7.0.0",
    "@babel/preset-react": "^7.0.0",
    "babel-jest": "26.6.3",
    "babel-register": "^6.26.0",
    "enzyme": "3.11.0",
    "enzyme-adapter-react-16": "1.15.6",
    "husky": "^4.3.6",
    "jest": "26.6.3",
    "lint-staged": "^10.5.4",
    "nodemon": "^2.0.7",
    "prettier": "2.2.1",
    "react-addons-test-utils": "15.6.2",
    "react-test-renderer": "16.14.0"
  },

Appreciate the help!

limeforadime commented 2 years ago

I can't speak for your exact error but I know people have been having problems with this package because it is basically deprecated now (it relies on @shopify/shopify-api which has breaking changes for koa-shopify-auth now)

I switched over to this good repo and it solved the problems I was having with authentication, give it a try: https://github.com/TheSecurityDev/simple-koa-shopify-auth

fwidyadri commented 2 years ago

@limeforadime thanks for the info. I will give it a try.