Skip to content
Snippets Groups Projects
Commit 8de95ead authored by Fabien Zucchet's avatar Fabien Zucchet
Browse files

add env variables for redirect_uri and listening port

parent a5e3607f
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ function getRedirectURI(){ ...@@ -13,7 +13,7 @@ function getRedirectURI(){
return url.format({ return url.format({
pathname:"https://auth.viarezo.fr/oauth/authorize", pathname:"https://auth.viarezo.fr/oauth/authorize",
query: { query: {
"redirect_uri": "http://leaderboard.viarezo.fr:3000/api/fallback", "redirect_uri": process.env.PROD_REDIRECT_URI,
"client_id": client_id, "client_id": client_id,
"response_type": "code", "response_type": "code",
"state": "aaa", // Generate a random here "state": "aaa", // Generate a random here
...@@ -27,7 +27,7 @@ async function getToken(code){ ...@@ -27,7 +27,7 @@ async function getToken(code){
const data = querystring.stringify({ const data = querystring.stringify({
grant_type: 'authorization_code', grant_type: 'authorization_code',
code: code, code: code,
redirect_uri: 'http://leaderboard.viarezo.fr:3000/api/fallback', redirect_uri: process.env.PROD_REDIRECT_URI,
client_id: client_id, client_id: client_id,
client_secret: client_secret client_secret: client_secret
}) })
......
...@@ -38,8 +38,8 @@ app.get('/api/logout', function(req, res){ ...@@ -38,8 +38,8 @@ app.get('/api/logout', function(req, res){
}); });
app.listen(8000, () => { app.listen(process.env.PORT, () => {
console.log(`App server now listening on port 8000`); console.log(`App server now listening on port ${process.env.PORT}`);
}); });
module.exports = app; module.exports = app;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment