Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
hotfix: Handle non email user (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed May 19, 2022
1 parent 4fec2bc commit 2edaa49
Show file tree
Hide file tree
Showing 6 changed files with 1,289 additions and 1,526 deletions.
52 changes: 26 additions & 26 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,72 +36,72 @@
"docker:logs": "docker logs -f hackatalk"
},
"dependencies": {
"@azure/storage-blob": "^12.9.0",
"@prisma/client": "3.11.1",
"@sendgrid/mail": "^7.6.2",
"apollo-server": "^3.6.6",
"axios": "^0.26.1",
"@azure/storage-blob": "^12.10.0",
"@prisma/client": "3.14.0",
"@sendgrid/mail": "^7.7.0",
"apollo-server": "^3.7.0",
"axios": "^0.27.2",
"bcrypt": "^5.0.1",
"ejs": "^3.1.7",
"ejs": "^3.1.8",
"generate-password": "^1.7.0",
"graphql-iso-date": "^3.6.1",
"graphql-middleware": "^6.1.20",
"graphql-middleware": "^6.1.26",
"graphql-redis-subscriptions": "^2.4.2",
"graphql-relay": "^0.10.0",
"graphql-shield": "^7.5.0",
"graphql-subscriptions": "^2.0.0",
"graphql-upload": "^13.0.0",
"helmet": "^5.0.2",
"i18next": "^21.6.14",
"helmet": "^5.1.0",
"i18next": "^21.8.3",
"i18next-http-middleware": "^3.2.0",
"i18next-node-fs-backend": "^2.1.3",
"ioredis": "^5.0.1",
"ioredis": "^5.0.5",
"jsonwebtoken": "^8.5.1",
"multer": "^1.4.4",
"nanoid": "^3.3.1",
"nanoid": "^3.3.4",
"nexus": "^1.3.0",
"node-rsa": "^1.1.1",
"ramda": "^0.28.0",
"stream-mime-type": "^1.0.2",
"verify-apple-id-token": "^2.1.0"
},
"devDependencies": {
"@dooboo/eslint-config": "^1.3.3",
"@dooboo/eslint-config": "^1.3.4",
"@types/bcrypt": "^5.0.0",
"@types/ejs": "^3.1.0",
"@types/ejs": "^3.1.1",
"@types/express": "^4.17.13",
"@types/graphql-iso-date": "^3.4.0",
"@types/ioredis": "^4.28.10",
"@types/jest": "^27.4.1",
"@types/jest": "^27.5.1",
"@types/jsonwebtoken": "8.5.8",
"@types/multer": "^1.4.7",
"@types/nanoid": "^3.0.0",
"@types/node": "^17.0.23",
"@types/node": "^17.0.34",
"@types/node-rsa": "^1.1.1",
"@types/ramda": "^0.28.3",
"@types/ramda": "^0.28.12",
"@types/ws": "8.5.3",
"@typescript-eslint/eslint-plugin": "^5.16.0",
"@typescript-eslint/eslint-plugin": "^5.25.0",
"apollo-cache-inmemory": "^1.6.6",
"apollo-client": "^2.6.10",
"apollo-datasource-rest": "^3.5.2",
"apollo-datasource-rest": "^3.5.3",
"apollo-link-ws": "^1.0.20",
"apollo-server-testing": "^2.25.3",
"casual": "^1.6.2",
"dotenv": "^16.0.0",
"dotenv": "^16.0.1",
"dotenv-cli": "^5.1.0",
"eslint": "^8.12.0",
"eslint": "^8.15.0",
"eslint-plugin-prettier": "^4.0.0",
"graphql-import": "^1.0.2",
"graphql-request": "^4.2.0",
"graphql-tag": "^2.12.6",
"jest": "27.5.1",
"node-fetch": "^3.2.3",
"prettier": "^2.6.1",
"prisma": "^3.11.1",
"ts-jest": "^27.1.4",
"jest": "28.1.0",
"node-fetch": "^3.2.4",
"prettier": "^2.6.2",
"prisma": "^3.14.0",
"ts-jest": "^28.0.2",
"ts-node": "10.7.0",
"ts-node-dev": "^1.1.8",
"typescript": "4.6.3"
"typescript": "4.6.4"
},
"engines": {
"node": ">=10.0.0"
Expand Down
8 changes: 5 additions & 3 deletions server/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,11 @@ export const runSubscriptionServer = (
},
);

['SIGINT', 'SIGTERM'].forEach((signal) => {
process.on(signal, () => subscriptionServer.close());
});
if (NODE_ENV === 'production') {
['SIGINT', 'SIGTERM'].forEach((signal) => {
process.on(signal, () => subscriptionServer.close());
});
}

return subscriptionServer;
};
2 changes: 1 addition & 1 deletion server/src/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class UserService {
authType: socialUser.authType,
},
},
email: socialUser.email,
email: socialUser.email || null,
name: socialUser.name,
birthday: socialUser.birthday,
gender: socialUser.gender,
Expand Down
2 changes: 1 addition & 1 deletion server/src/utils/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export interface FacebookUser {
export const verifyFacebookId = async (
accessToken: string,
): Promise<FacebookUser> => {
const {data} = await axios.get('https://graph.facebook.com/v10.0/me', {
const {data} = await axios.get('https://graph.facebook.com/v13.0/me', {
params: {
access_token: accessToken,
fields: 'id,name,email,picture',
Expand Down
2 changes: 0 additions & 2 deletions server/tests/resolvers/user.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ describe('Resolver - User', () => {
} catch (e) {
const response = e.response;

console.log(e.request);

expect(response.errors[0].message).toEqual(
i18next.t(ErrorString.UserNotExists),
);
Expand Down
Loading

0 comments on commit 2edaa49

Please sign in to comment.