-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12414 from rtibbles/verboten
Properly redirect on authentication failure
- Loading branch information
Showing
5 changed files
with
32 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import urls from 'kolibri.urls'; | ||
|
||
export default function redirectBrowser(url) { | ||
window.location.href = url || urls['kolibri:core:redirect_user'](); | ||
export default function redirectBrowser(url, next = false) { | ||
url = url || urls['kolibri:core:redirect_user'](); | ||
const urlObject = new URL(url, window.location.origin); | ||
if (next) { | ||
urlObject.searchParams.set('next', encodeURIComponent(window.location.href)); | ||
} | ||
window.location.href = urlObject.href; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters