mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-24 05:05:39 +00:00
check oauth2 authorization code redirect for exact 'code' query parameter (#1777)
Co-authored-by: Stefan Grüttner <stefan.gruettner@deutschebahn.com>
This commit is contained in:
@@ -24,7 +24,7 @@ const authorizeUserInWindow = ({ authorizeUrl, callbackUrl, session }) => {
|
||||
|
||||
function onWindowRedirect(url) {
|
||||
// check if the url contains an authorization code
|
||||
if (url.match(/(code=).*/)) {
|
||||
if (new URL(url).searchParams.has('code')) {
|
||||
finalUrl = url;
|
||||
if (!url || !finalUrl.includes(callbackUrl)) {
|
||||
reject(new Error('Invalid Callback Url'));
|
||||
|
||||
Reference in New Issue
Block a user