diff --git a/lib/requests/sharing-request.js b/lib/requests/sharing-request.js index 8a52fc57..c67c7df2 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) }