Skip to content

Commit

Permalink
fix(twitch-login): Fix first login when server port is occupied (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
skarab42 authored Feb 3, 2021
1 parent b0d21ee commit c2ee324
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async function start() {
p.use(sirv(path, { dev: true }));
});

p.use(require("./libs/twitch/authMiddleware"))
p.use(require("./libs/twitch/authMiddleware")())
.post("/locales/add/:lng/:ns", missingKeyHandler)
.listen(port, async (error) => {
if (error) return onError(error);
Expand Down
4 changes: 2 additions & 2 deletions app/server/libs/twitch/authMiddleware.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { authProvider } = require("./index");
const twitch = require("./index");

function twitchAuth(req, res) {
if (req.query.error) {
Expand Down Expand Up @@ -36,4 +36,4 @@ function authMiddleware(req, res, next) {
next();
}

module.exports = authMiddleware.bind(authProvider);
module.exports = () => authMiddleware.bind(twitch.authProvider);

0 comments on commit c2ee324

Please sign in to comment.