Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamvishu committed Jul 26, 2021
1 parent f3aaab8 commit 7dd48e3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
Binary file modified .DS_Store
Binary file not shown.
6 changes: 5 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
API_KEY=5026e5a981424f77910a4e5ef90ccaee
URL=mongodb+srv://user1:[email protected]/blogapp?retryWrites=true&w=majority
URL=mongodb+srv://user1:[email protected]/blogapp?retryWrites=true&w=majority
FclientID=1117464492042774
FclientSecret=9606dfdf09176dbfb76a77978b8ae445
GclientID=337678311940-282brvhmo1k5v9nbdv53v60ap04rvfno.apps.googleusercontent.com
GclientSecret=C3iFUDa2vJEvFYbcg2Tu-0iB
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
.env
#config/keys.js
/.env
/config/keys.js
3 changes: 1 addition & 2 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const passport = require('passport');
const keys = require('./config/keys');
var express = require("express"),
app = express(),
bodyParser = require('body-parser'),
Expand All @@ -10,7 +9,7 @@ var express = require("express"),
blogRoutes = require('./routes/blogs-routes');

//mongoose.connect("mongodb://localhost/authdemo",{ useNewUrlParser: true,useUnifiedTopology: true} );
mongoose.connect(keys.mongo.URI,{ useNewUrlParser: true,useUnifiedTopology: true} );
mongoose.connect(process.env.URL,{ useNewUrlParser: true,useUnifiedTopology: true} );

mongoose.set('useFindAndModify', false);
app.use(express.static("public"));
Expand Down
8 changes: 4 additions & 4 deletions config/passport-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ function chooseGoogleStrategy(req,res,next){
console.log("\n\n\n\nSHUBHAM\n\n\n\n");
passport.use(new GoogleStrategy({
callbackURL:'/auth/google/redirect',
clientID:keys.google.clientID,
clientSecret:keys.google.clientSecret
clientID: process.env.GclientID,
clientSecret: process.env.GclientSecret
},(accessToken,refreshToken,profile,done)=>{

console.log("passport callback");
Expand Down Expand Up @@ -80,8 +80,8 @@ function chooseGoogleStrategy(req,res,next){
}
function chooseFacebookStrategy(req,res,next){
passport.use(new FacebookStrategy({
clientID: keys.facebook.clientID,
clientSecret: keys.facebook.clientSecret,
clientID: process.env.FclientID,
clientSecret: process.env.FclientSecret,
callbackURL: "https://xyz0.herokuapp.com/auth/facebook/redirect",
profileFields: ['id', 'displayName', 'photos', 'email']
},
Expand Down

0 comments on commit 7dd48e3

Please sign in to comment.