Skip to content

Commit

Permalink
Use proxy_session query argument to extract OAuth session info (#224)
Browse files Browse the repository at this point in the history
Needed to complete PKCE authentication correctly
  • Loading branch information
gcampax committed Jun 23, 2021
1 parent e428d99 commit 3bfc4b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routes/devices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ router.get('/oauth2/callback/:kind', (req, res, next) => {
const kind = req.params.kind;
const engine = req.app.genie;
Promise.resolve().then(async () => {
await engine.completeOAuth(kind, req.url, req.session as unknown as Record<string, string>);
const session = (req.query.proxy_session || {}) as Record<string, string>;
await engine.completeOAuth(kind, req.url, session);
res.redirect(Config.BASE_URL + '/devices?class=online');
}).catch((e) => {
console.log(e.stack);
Expand Down

0 comments on commit 3bfc4b6

Please sign in to comment.