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

Merge pull request #1 from silkie261001/main #11

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7,765 changes: 3,990 additions & 3,775 deletions Games/2048-animated/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Games/2048-animated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "set PORT=3457 && react-scripts start",
"start": "set PORT=3456 && react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
Expand Down
9,913 changes: 4,058 additions & 5,855 deletions Games/memory-game/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Games/memory-game/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"web-vitals": "^1.1.2"
},
"scripts": {
"start": "set PORT=3456 && react-scripts start",
"start": "set PORT=3457 && react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
Expand Down
9 changes: 9 additions & 0 deletions backend/controllers/2048animated.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function animatedGameController() {
return {
index(req, res) {
return res.render("index");
},
};
}

module.exports = animatedGameController;
9 changes: 9 additions & 0 deletions backend/controllers/chatController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function chatController() {
return {
index(req, res) {
return res.render("index");
},
};
}

module.exports = chatController;
9 changes: 9 additions & 0 deletions backend/controllers/memoryGameController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function memoryGameController() {
return {
index(req, res) {
return res.render("index");
},
};
}

module.exports = memoryGameController;
13 changes: 13 additions & 0 deletions backend/database-c051f-5b8ec5e81639.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "service_account",
"project_id": "database-c051f",
"private_key_id": "5b8ec5e81639e80eea44544b274308607865e38f",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDR+IAhO6OK29EY\nYRMCJIaSf4XTE4nNfuGlJ+MoIOiQfT8YbbuBaSuylHhut8q4GQnUwQa93jBaZ/mz\nUlcOydxbTgdQqhxeteqVqeRIudZa374g5krlQR6tz7NCc0sEvoZeKu4H5g1wEYEy\n9d2WU8ylqkW4xjrhwqXlW/AOsQ9rQGsWp289hbSDIUf7qeCbWaYxn1GRBGAQneuM\nYS+csLszfnUVpuTFRpxwkzvumbe9XuEllE8rd4fogjG84zLcJRziGpkIRedV/WLV\ncrQS4SZKgm0ya0YQzdAFtCf+YJkCJmnMK32cCETzIkd3OxOG+vo4e9mV7oZM87CM\nsi3cCnFPAgMBAAECggEAGmWCPitQORG/bLAvgpJy9JHhkhKfvVzZIzkrfoz8j8Wf\nHAQXkYJWQwIVTd3/Nzu2l6+YmGAJdiQiKSAN38cS08uwcbyhCmsWTbBpCZeLUitU\nrLAm9EFGiRVWdOEnqjYFkGsXN5j9UXxx4KU2MULhtGX+k+cf2eftkTMIr+Akjxf0\n0uCUmttc1/qcWCpqlP3Vmz5adBGEkX8e+/0kTAC2LWMXBITjKGd3i+BH3aVLoZ4j\nGHh5ineAg85/0hCGLMsJooYuglQ9P0l4tYtmN9KkS7tKOsWrAbo1SX7Cm4vTCivz\n3C/lXZB52n0xgXWbyrDteB4f9Bb53uBkp0ur+dkboQKBgQDpiQNod0vjfa6NfLda\nASIQSZKrBOwcdtDjyFvquDfViH+UTCg5DIwL+rIW3aFcp02m6LD2FdKIPXiPcEPu\n4LVEKsDX2Oh+CKKGLbht+J5Wx8LHhBnP3BiTqfQVkcUCY5TUXbz5MpVnAD3xmgrj\n2uBlRHaKxlcIc9sVbZlWG+x50QKBgQDmKzFjStdMHesnCVE1jf41ZS0xLRwBA3xK\ngR6FhGXwEuwZId2i03ZNHguI3viAp5VaeK7177xVinFk4lCliZ1Sf/yJ1JTDZNKk\nwbNCTg/ZaTh0jfnIwE57KeDxUsYThyQODCjOYSBbyleEuyFLiMiz7ikplI7C/Lop\nmFQubKfhHwKBgEuO/P9Luc382AEHHPuN6kuCwmV6zjnXZ3aLWNH0kHwSEdUVXt42\nZQlrLzuesZqcts8N8lNsdBWIbf1awWAEbCGGA6bSk0ZT3OG04TsTeYdyUl7jKsbJ\n21nLXyGrbCZ9uaWMPpwR9azBs0j8IhHeu0OIhyIXUgl2Eqg4MahemIBBAoGBAJyP\nUL67T4sE5sjcu5J0DTAArCbBCkVeO5LqFPq4viX4mQPXV0zEDboS78Gf+OR6GUs6\nv7el5DNDQjJfBoAzBQHy8LJIGRB3ahiLcQVu17UIr1AIqpj0xe1c5RcBOJ5b1BiC\nCNeolTwafEFakCEy32IUY4dW92yGP5K/fLM/UUn9AoGBAKy+aJVIEwe+75QPwIRf\n6a/14PYNYVk2xXorCiLOT5orgavZNipsYdyShfyHbQIerh09/KZldtE71HlBsnYO\nt9E4amHqv0/zmU1/eAl5Bt0228cD4/WONG1oIcAQHeB5pcSbHrQGdSpzo+rUYkJp\nz7WDZxQmtmcy+XnvbZMtK0sP\n-----END PRIVATE KEY-----\n",
"client_email": "[email protected]",
"client_id": "117421588185873221418",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/chatbot%40database-c051f.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
22 changes: 22 additions & 0 deletions backend/middleware/2048animated.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const jwt = require("jsonwebtoken");

const config = process.env;

const verifyToken = (req, res, next) => {
let token = req.body.token || req.query.token || req.headers["authorization"];

if (!token) {
return res.status(403).send("A token is required for authentication");
}
try {
token = token.replace(/^Bearer\s+/, "");
const decoded = jwt.verify(token, config.TOKEN_KEY);
req.user = decoded;
} catch (err) {
return res.status(401).send("Invalid Token");
}

return next();
};

module.exports = verifyToken;
22 changes: 22 additions & 0 deletions backend/middleware/chat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const jwt = require("jsonwebtoken");

const config = process.env;

const verifyToken = (req, res, next) => {
let token = req.body.token || req.query.token || req.headers["authorization"];

if (!token) {
return res.status(403).send("A token is required for authentication");
}
try {
token = token.replace(/^Bearer\s+/, "");
const decoded = jwt.verify(token, config.TOKEN_KEY);
req.user = decoded;
} catch (err) {
return res.status(401).send("Invalid Token");
}

return next();
};

module.exports = verifyToken;
22 changes: 22 additions & 0 deletions backend/middleware/memoryGame.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const jwt = require("jsonwebtoken");

const config = process.env;

const verifyToken = (req, res, next) => {
let token = req.body.token || req.query.token || req.headers["authorization"];

if (!token) {
return res.status(403).send("A token is required for authentication");
}
try {
token = token.replace(/^Bearer\s+/, "");
const decoded = jwt.verify(token, config.TOKEN_KEY);
req.user = decoded;
} catch (err) {
return res.status(401).send("Invalid Token");
}

return next();
};

module.exports = verifyToken;
Loading