feat(#1003): closing stale 'authorize' windows | handling error, error_description, error_uri query params for oauth2 | clear authorize window cache for authorization_code oauth2 flow (#1719)

* feat(#1003): oauth2 support
---------

Co-authored-by: lohit-1 <lohit@usebruno.com>
This commit is contained in:
lohit
2024-03-11 01:51:55 +05:30
committed by GitHub
parent 86ddd2b9b0
commit 6a05321109
8 changed files with 202 additions and 16 deletions

View File

@@ -51,6 +51,13 @@ router.get('/authorize', (req, res) => {
const redirectUrl = `${redirect_uri}?code=${authorization_code}`;
try {
// validating redirect URL
const url = new URL(redirectUrl);
} catch (err) {
return res.status(401).json({ error: 'Invalid redirect URI' });
}
const _res = `
<html>
<script>