From 1deb9db00b36adc6b8c167f761be2cdf9de4ac7f Mon Sep 17 00:00:00 2001 From: bourgeoa Date: Fri, 8 Mar 2024 18:11:29 +0100 Subject: [PATCH] check for redirect_uri --- lib/requests/sharing-request.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/requests/sharing-request.js b/lib/requests/sharing-request.js index 8a52fc570..c67c7df21 100644 --- a/lib/requests/sharing-request.js +++ b/lib/requests/sharing-request.js @@ -64,10 +64,11 @@ class SharingRequest extends AuthRequest { * @param req {IncomingRequest} * @param res {ServerResponse} */ - static async get (req, res) { + static async get (req, res, next) { const request = SharingRequest.fromParams(req, res) const appUrl = request.getAppUrl() + if (!appUrl) return next() const appOrigin = appUrl.origin const serverUrl = new url.URL(req.app.locals.ldp.serverUri) @@ -153,6 +154,7 @@ class SharingRequest extends AuthRequest { } getAppUrl () { + if (!this.authQueryParams.redirect_uri) return return new url.URL(this.authQueryParams.redirect_uri) }