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
import React, { useState, useEffect } from 'react' | |
import PropTypes from 'prop-types' | |
import { checkIsAuthenticated, authSignUp, authLogin, authLogout } from '../../services/auth' | |
export const AuthContext = React.createContext({}) | |
export default function Auth({ children }) { | |
const [isAuthenticated, setIsAuthenticated] = useState(false) | |
const [isLoading, setIsLoading] = useState(true) |
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
const PORT = 3000; | |
const SECRET = 'APP_SHARED_SECRET'; | |
var http = require('http'), | |
crypto = require('crypto'), | |
server; | |
function verifyShopifyHook(req) { | |
var digest = crypto.createHmac('SHA256', SECRET) | |
.update(new Buffer(req.body, 'utf8')) |