auth-node: fix OAuth redirect flow return

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-08-07 11:16:25 +02:00
parent d30b4e387a
commit e14ad7c018
@@ -241,9 +241,11 @@ export function createOAuthRouteHandlers<TProfile>(
);
}
res.redirect(state.redirectUrl);
return;
}
// post message back to popup if successful
return sendWebMessageResponse(res, appOrigin, {
sendWebMessageResponse(res, appOrigin, {
type: 'authorization_response',
response,
});
@@ -252,7 +254,7 @@ export function createOAuthRouteHandlers<TProfile>(
? error
: new Error('Encountered invalid error'); // Being a bit safe and not forwarding the bad value
// post error message back to popup if failure
return sendWebMessageResponse(res, appOrigin, {
sendWebMessageResponse(res, appOrigin, {
type: 'authorization_response',
error: { name, message },
});