Skip to content

Commit

Permalink
fix: add sameSite to solve ionic can't access the api
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Sep 1, 2021
1 parent eec4b7b commit 9c50621
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,16 @@ app.use(session(
store : new MongoStore({
url : mongoConnectionURL
}) ,
cookie : {maxAge: 60 * 60* 24 * 1000} ,
cookie : {
maxAge: 60 * 60* 24 * 1000,
sameSite: 'none',
secure : true
} ,
expires : new Date(Date.now() + (86400 * 1000))
}
));
app.set('trust proxy', 1);

app.use(passport.initialize());
app.use(passport.session());

Expand Down

0 comments on commit 9c50621

Please sign in to comment.