web/flows: fix RedirectStage not detecting absolute URLs correctly (#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>
This commit is contained in:
Saeverix 2023-05-29 14:20:40 +02:00 committed by Jens Langhammer
parent 5e5a74eebf
commit 317afc932a
No known key found for this signature in database

View file

@ -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 {