Skip to content

Commit

Permalink
web/flows: fix RedirectStage not detecting absolute URLs correctly (#…
Browse files Browse the repository at this point in the history
…5781)

* web: getURL() method in RedirectStage.ts now actually detects URLs (#5732)

Signed-off-by: Saeverix <1863379+Saeverix@users.noreply.github.com>

* use native API to build full URL

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Saeverix <1863379+Saeverix@users.noreply.github.com>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
  • Loading branch information
Saeverix and BeryJu committed May 29, 2023
1 parent 4a41811 commit 47a916a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions web/src/flow/stages/RedirectStage.ts
Expand Up @@ -39,10 +39,7 @@ export class RedirectStage extends BaseStage<RedirectChallenge, FlowChallengeRes
}

getURL(): string {
if (!this.challenge.to.includes("://")) {
return window.location.origin + this.challenge.to;
}
return this.challenge.to;
return new URL(this.challenge.to, document.baseURI).toString();
}

firstUpdated(): void {
Expand Down

0 comments on commit 47a916a

Please sign in to comment.