Skip to content

Commit

Permalink
check for redirect_uri
Browse files Browse the repository at this point in the history
  • Loading branch information
bourgeoa committed Mar 8, 2024
1 parent d8290cb commit 1deb9db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/requests/sharing-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -153,6 +154,7 @@ class SharingRequest extends AuthRequest {
}

getAppUrl () {
if (!this.authQueryParams.redirect_uri) return
return new url.URL(this.authQueryParams.redirect_uri)
}

Expand Down

0 comments on commit 1deb9db

Please sign in to comment.