summaryrefslogtreecommitdiff
path: root/src/Auth.js
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2024-11-26 04:13:31 -0500
committerLLLL Colonq <llll@colonq>2024-11-26 04:13:31 -0500
commitd5ffc77a120b304d98dbd31b3272bcd312334385 (patch)
tree2a4f2cbebe503bbea4fda131f704ef21042b7ac9 /src/Auth.js
parentf186a0bc9a56f12aaa0ae50d0e50c4be8d0f91c9 (diff)
Redirect URL on login page
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"];