-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from ctrlaltdylan/nextjs-toolbox-v2
nextjs toolbox v2
- Loading branch information
Showing
9 changed files
with
769 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "shopify-session-tokens-nextjs", | ||
"version": "0.2.0-beta.7", | ||
"private": false, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start" | ||
}, | ||
"dependencies": { | ||
"@shopify/app-bridge": "^2.0.3", | ||
"@shopify/app-bridge-react": "^2.0.3", | ||
"@shopify/app-bridge-utils": "^2.0.3", | ||
"@shopify/polaris": "^6.6.0", | ||
"axios": "^0.21.0", | ||
"global": "^4.4.0", | ||
"js-cookie": "^2.2.1", | ||
"jsonwebtoken": "^8.5.1", | ||
"lodash": "^4.17.20", | ||
"next": "10.0.0", | ||
"nonce": "^1.0.4", | ||
"react": "17.0.1", | ||
"react-dom": "17.0.1", | ||
"shopify-nextjs-toolbox": "file:.yalc/shopify-nextjs-toolbox", | ||
"yalc": "^1.0.0-pre.53" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
import { handleAuthStart } from "shopify-nextjs-toolbox"; | ||
|
||
export default handleAuthStart(); | ||
// optional: save the nonce generated within handleAuthStart | ||
// handleAuthStart generates a unique nonce for you, no need to break out a crypto library | ||
// after OAuth is complete, you can compare the nonce generated at this step vs the end for extra security | ||
async function saveNonce({ req, shopName, nonce }) { | ||
// within this function, associate the nonce with the shopName of the merchant logging in you data store of choice | ||
// then within pages/api/auth/callback.js we'll verify the nonce is the same | ||
// not sure how to do this? Just don't pass saveNonce to handleAuthStart | ||
} | ||
|
||
export default handleAuthStart({ saveNonce }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"version": "v1", | ||
"packages": { | ||
"shopify-nextjs-toolbox": { | ||
"signature": "57e5bb9dd9893ef3076cdedd2ada79c7", | ||
"file": true, | ||
"replaced": "link:../shopify-nextjs-toolbox" | ||
} | ||
} | ||
} |
Oops, something went wrong.