summaryrefslogtreecommitdiff
path: root/src/Auth.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/Auth.js')
-rw-r--r--src/Auth.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Auth.js b/src/Auth.js
index 3c077ce..998dc1a 100644
--- a/src/Auth.js
+++ b/src/Auth.js
@@ -49,7 +49,14 @@ export const _clearSessionCookie = () => {
document.cookie = "authelia_session=; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=None; Secure";
};
-export const _getRedirect = (Just) => (Nothing) => (x) => () => {
+export const _getQueryRedirect = (Just) => (Nothing) => () => {
+ const ps = new URLSearchParams(window.location.search);
+ const p = ps?.get("rd");
+ if (p) return Just(p);
+ return Nothing;
+};
+
+export const _getResponseRedirect = (Just) => (Nothing) => (x) => () => {
const data = x["data"];
if (!data) return Nothing;
const r = x["data"]["redirect"];