Skip to content
This repository has been archived by the owner on Nov 25, 2019. It is now read-only.

Commit

Permalink
Trim whitespace on oauth credentials for better Windows support with …
Browse files Browse the repository at this point in the history
…`set`
  • Loading branch information
MadLittleMods committed Jul 5, 2016
1 parent ff6e5ae commit 180bbe6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app.js
Expand Up @@ -10,8 +10,8 @@ var gitterHost = process.env.HOST || 'https://gitter.im';
var port = process.env.PORT || 7000;

// Client OAuth configuration
var clientId = process.env.GITTER_KEY;
var clientSecret = process.env.GITTER_SECRET;
var clientId = process.env.GITTER_KEY ? process.env.GITTER_KEY.trim() : undefined;
var clientSecret = process.env.GITTER_SECRET ? process.env.GITTER_SECRET.trim() : undefined;

// Gitter API client helper
var gitter = {
Expand Down Expand Up @@ -89,11 +89,11 @@ passport.deserializeUser(function (user, done) {
done(null, JSON.parse(user));
});

app.get('/login',
app.get('/login',
passport.authenticate('oauth2')
);

app.get('/login/callback',
app.get('/login/callback',
passport.authenticate('oauth2', {
successRedirect: '/home',
failureRedirect: '/'
Expand All @@ -118,8 +118,8 @@ app.get('/home', function(req, res) {
if (err) return res.send(500);

res.render('home', {
user: req.user,
token: req.session.token,
user: req.user,
token: req.session.token,
clientId: clientId,
rooms: rooms
});
Expand Down

0 comments on commit 180bbe6

Please sign in to comment.