Skip to content

Commit

Permalink
remove hard coded google api key
Browse files Browse the repository at this point in the history
  • Loading branch information
basemkhirat committed Jun 26, 2020
1 parent 4b36614 commit bfaa05b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ MAIL_SECURE=true
MAIL_USER=
MAIL_PASSWORD=

GOOGLE_KEY=
AWS_KEY=
AWS_SECRET=
YOUTUBE_KEY=
SOUNDCLOUD_KEY=

12 changes: 4 additions & 8 deletions config/services.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export default {
google: {
key: process.env.GOOGLE_KEY,
},

aws: {
/**
* your AWS access key ID
Expand All @@ -19,15 +23,7 @@ export default {
region: process.env.AWS_REGION || "eu-west-1",
},

youtube: {
key: process.env.YOUTUBE_KEY,
},

soundcloud: {
key: process.env.SOUNDCLOUD_KEY,
},

google: {
key: process.env.GOOGLE_KEY,
},
};
4 changes: 3 additions & 1 deletion controllers/v1/AuthController.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,9 @@ export default class extends Controller {
let access_token = req.param("access_token");

let url =
"https://www.googleapis.com/oauth2/v3/userinfo?key=AIzaSyA111zEWbTLDGx8BjWYjPNPuv2CD0fBtVM&access_token=" +
"https://www.googleapis.com/oauth2/v3/userinfo?key=" +
Config.get("services.google.key") +
"&access_token=" +
access_token;

let api = await HTTP.get(url);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test": "export APP_CONSOLE=true && ./node_modules/.bin/mocha tests/**/*.js --require @babel/register --exit"
},
"dependencies": {
"dotapp": "^2.2.16"
"dotapp": "^2.2.17"
},
"devDependencies": {
"@babel/cli": "^7.5.5",
Expand Down

0 comments on commit bfaa05b

Please sign in to comment.