Closed rivernews closed 4 years ago
Also have to update Google Oath callback url: https://console.developers.google.com/apis/credentials/oauthclient/732988498848-vuhd6g61bnlqe372i3l5pbpnerteu6na.apps.googleusercontent.com?project=732988498848.
Frontend got error when trying to do social auth: "Not a valid origin for the client: https://appl-tracky.shaungc.com has not been whitelisted for client ID 732988498848-vuhd6g61bnlqe372i3l5pbpnerteu6na.apps.googleusercontent.com. Please go to https://console.developers.google.com/ and whitelist this origin for your project's client ID."
After adding the new subdomain to backend django CORS whitelist, the error is gone now.
Had to do the following. Perhaps not all of them are necessary, but if we do all these, it works, so. The github page doc on setting up github page for subdomain is pretty lack of detail or it's outdated. They didn't even mention the
CNAME
file.CNAME
for sundomainappl-tracky.shaungc.com
, point torivernews.github.io
. That's right, no need to point to project repo sub path. Github will handle the routing.CNAME
, containing the textappl-tracky.shaungc.com
, place it insrc/
.CNAME
file exists in thegh-page
branch root, we need to make sure it's inbuild/
. Inpackage.json
, for thedeploy
(orbuild
) script, add something likecp src/CNAME build/CNAME
. Also configure 404 page. At the end, do something like this"build": "react-scripts build && cp src/CNAME build/CNAME && cp build/index.html build/404.html"
.package.json
home page as"homepage": "https://appl-tracky.shaungc.com",
.npm run deploy
.appl-tracky.shaungc.com
. Also enable the "enforce HTTP".