Skip to content

Commit cb49a75

Browse files
committed
testing ?fix?
1 parent 282dde0 commit cb49a75

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

src/auth.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,15 @@ function registerOauth() {
126126
})
127127
}
128128

129-
let handled
130129
if (req.hostname !== redirectURL.hostname) {
131-
handled = await handleServiceUrl(req, res)
130+
return handleServiceUrl(req, res)
132131
}
133132

134133
if (!req.isAuthenticated()) {
135134
return res.redirect("/auth")
136135
}
137136

138-
if (!handled) {
139-
next()
140-
}
137+
next()
141138
})
142139

143140
router.get("/auth", passport.authenticate("oauth2"))
@@ -164,13 +161,11 @@ function registerFakeAuth() {
164161
sameSite: "lax",
165162
maxAge: 1000 * 60 * 60,
166163
})
164+
} else {
165+
return await handleServiceUrl(req, res)
167166
}
168167

169-
const handled = await handleServiceUrl(req, res)
170-
171-
if (!handled) {
172-
next()
173-
}
168+
next()
174169
})
175170

176171
router.get("/auth", (req, res) => {

0 commit comments

Comments
 (0)