Skip to content

Commit 7f09528

Browse files
committed
fix: the condition to show the dialog
1 parent 40609e9 commit 7f09528

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/oauth/server.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,15 @@ authRouter.get(
182182
}
183183

184184
if (await isClientAlreadyApproved(req, client.id, COOKIE_SECRET)) {
185-
res.render('approval-dialog', {
186-
client,
187-
state: btoa(JSON.stringify(requestParams)),
188-
});
185+
const authUrl = await upstreamAuth(btoa(JSON.stringify(requestParams)));
186+
res.redirect(authUrl.href);
189187
return;
190188
}
191189

192-
const authUrl = await upstreamAuth(btoa(JSON.stringify(requestParams)));
193-
res.redirect(authUrl.href);
190+
res.render('approval-dialog', {
191+
client,
192+
state: btoa(JSON.stringify(requestParams)),
193+
});
194194
},
195195
);
196196

0 commit comments

Comments
 (0)