diff --git a/src/modules/Auth/PasswortVergessenModule.svelte b/src/modules/Auth/PasswortVergessenModule.svelte
index dc5834d0..e3481045 100644
--- a/src/modules/Auth/PasswortVergessenModule.svelte
+++ b/src/modules/Auth/PasswortVergessenModule.svelte
@@ -13,6 +13,7 @@
try {
sent = true
const response = await api.auth["passwort-vergessen"].GET.fetch({
+ redirect,
email
})
@@ -57,7 +58,7 @@
{#if showEmailSuccess}
+
diff --git a/src/pages/[partner]/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/index.astro b/src/pages/[partner]/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/index.astro
index 9979687d..101e4c2d 100644
--- a/src/pages/[partner]/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/index.astro
+++ b/src/pages/[partner]/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/index.astro
@@ -20,7 +20,7 @@ const user = await getCurrentUser(Astro)
if (id) {
if (!user) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
@@ -57,7 +57,7 @@ if (id) {
} else if (aufnahme_id) {
if (!user) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
diff --git a/src/pages/[partner]/angebot-anfragen/geg-nachweis-gewerbe-anfragen/index.astro b/src/pages/[partner]/angebot-anfragen/geg-nachweis-gewerbe-anfragen/index.astro
index 66a26817..3aa9dd70 100644
--- a/src/pages/[partner]/angebot-anfragen/geg-nachweis-gewerbe-anfragen/index.astro
+++ b/src/pages/[partner]/angebot-anfragen/geg-nachweis-gewerbe-anfragen/index.astro
@@ -20,7 +20,7 @@ const user = await getCurrentUser(Astro)
if (id) {
if (!user) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
@@ -57,7 +57,7 @@ if (id) {
} else if (aufnahme_id) {
if (!user) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
diff --git a/src/pages/[partner]/angebot-anfragen/geg-nachweis-wohnen-anfragen/index.astro b/src/pages/[partner]/angebot-anfragen/geg-nachweis-wohnen-anfragen/index.astro
index 4e5309b7..aebd1fbc 100644
--- a/src/pages/[partner]/angebot-anfragen/geg-nachweis-wohnen-anfragen/index.astro
+++ b/src/pages/[partner]/angebot-anfragen/geg-nachweis-wohnen-anfragen/index.astro
@@ -21,7 +21,7 @@ const user = await getCurrentUser(Astro)
if (id) {
if (!user) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
@@ -58,7 +58,7 @@ if (id) {
} else if (aufnahme_id) {
if (!user) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
diff --git a/src/pages/[partner]/energieausweis-erstellen/[ausweisart]/index.astro b/src/pages/[partner]/energieausweis-erstellen/[ausweisart]/index.astro
index 9dc72bad..68854f42 100644
--- a/src/pages/[partner]/energieausweis-erstellen/[ausweisart]/index.astro
+++ b/src/pages/[partner]/energieausweis-erstellen/[ausweisart]/index.astro
@@ -57,7 +57,7 @@ let loadFromDatabase = false;
if (typ === AusstellungsTyp.Neuausstellung) {
if (!user) {
- return Astro.redirect(`/auth/login?redirect=${Astro.url.toString()}`);
+ return Astro.redirect(`/auth/login?r=${Astro.url.toString()}`);
}
if (!ausweis_id) {
@@ -115,7 +115,7 @@ if (typ === AusstellungsTyp.Neuausstellung) {
loadFromDatabase = true;
} else if (typ === AusstellungsTyp.Speichern) {
if (!user) {
- return Astro.redirect(`/auth/login?redirect=${Astro.url.toString()}`);
+ return Astro.redirect(`/auth/login?r=${Astro.url.toString()}`);
}
if (!ausweis_id) {
@@ -151,7 +151,7 @@ if (typ === AusstellungsTyp.Neuausstellung) {
loadFromDatabase = true;
} else if (typ === AusstellungsTyp.Alternativdokument) {
if (!user) {
- return Astro.redirect(`/auth/login?redirect=${Astro.url.toString()}`);
+ return Astro.redirect(`/auth/login?r=${Astro.url.toString()}`);
}
if (!ausweis_id) {
diff --git a/src/pages/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/index.astro b/src/pages/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/index.astro
index 4cb45722..c0a047ca 100644
--- a/src/pages/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/index.astro
+++ b/src/pages/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/index.astro
@@ -20,7 +20,7 @@ const user = await getCurrentUser(Astro)
if (id) {
if (!user) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
@@ -58,7 +58,7 @@ if (id) {
} else if (aufnahme_id) {
if (!user) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
diff --git a/src/pages/angebot-anfragen/geg-nachweis-gewerbe-anfragen/index.astro b/src/pages/angebot-anfragen/geg-nachweis-gewerbe-anfragen/index.astro
index 8b78c111..24c874e8 100644
--- a/src/pages/angebot-anfragen/geg-nachweis-gewerbe-anfragen/index.astro
+++ b/src/pages/angebot-anfragen/geg-nachweis-gewerbe-anfragen/index.astro
@@ -20,7 +20,7 @@ const user = await getCurrentUser(Astro)
if (id) {
if (!user) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
@@ -58,7 +58,7 @@ if (id) {
} else if (aufnahme_id) {
if (!user) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
diff --git a/src/pages/angebot-anfragen/geg-nachweis-wohnen-anfragen/index.astro b/src/pages/angebot-anfragen/geg-nachweis-wohnen-anfragen/index.astro
index f9a86276..e5de8e60 100644
--- a/src/pages/angebot-anfragen/geg-nachweis-wohnen-anfragen/index.astro
+++ b/src/pages/angebot-anfragen/geg-nachweis-wohnen-anfragen/index.astro
@@ -21,7 +21,7 @@ const user = await getCurrentUser(Astro)
if (id) {
if (!user) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
@@ -59,7 +59,7 @@ if (id) {
} else if (aufnahme_id) {
if (!user) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
diff --git a/src/pages/api/auth/passwort-vergessen.ts b/src/pages/api/auth/passwort-vergessen.ts
index cc672f2f..c134fb7b 100644
--- a/src/pages/api/auth/passwort-vergessen.ts
+++ b/src/pages/api/auth/passwort-vergessen.ts
@@ -9,7 +9,8 @@ import { transport } from "#lib/mail.js";
export const GET = defineApiRoute({
input: z.object({
- email: z.string().email()
+ email: z.string().email(),
+ redirect: z.string().optional()
}),
output: z.void(),
async fetch(input, context, transfer) {
@@ -42,7 +43,7 @@ export const GET = defineApiRoute({
sie haben eine Anfrage zum Zurücksetzen ihres Passworts gestellt. Klicken sie auf den folgenden Link, um ein neues Passwort festzulegen:
-https://online-energieausweis.org/auth/passwort-zuruecksetzen?t=${resetToken}
+https://online-energieausweis.org/auth/passwort-zuruecksetzen?t=${resetToken}${input.redirect ? `&r=${input.redirect}` : ""}
Dieser Link ist für die nächsten 15 Minuten gültig. Falls du diese Anfrage nicht gestellt hast, kannst du diese E-Mail ignorieren - dein Passwort bleibt unverändert.
diff --git a/src/pages/auth/embedded-login.astro b/src/pages/auth/embedded-login.astro
deleted file mode 100644
index 343114a1..00000000
--- a/src/pages/auth/embedded-login.astro
+++ /dev/null
@@ -1,9 +0,0 @@
----
-import BlankLayout from "#layouts/BlankLayout.astro";
-import EmbeddedLoginModule from "#modules/EmbeddedLoginModule.svelte";
-
----
-
-
-
-
\ No newline at end of file
diff --git a/src/pages/auth/embedded-signup.astro b/src/pages/auth/embedded-signup.astro
deleted file mode 100644
index 5cd96347..00000000
--- a/src/pages/auth/embedded-signup.astro
+++ /dev/null
@@ -1,10 +0,0 @@
----
-import BlankLayout from "#layouts/BlankLayout.astro";
-import EmbeddedRegisterModule from "#modules/EmbeddedRegisterModule.svelte";
-
-const redirect = Astro.url.searchParams.get("redirect");
----
-
-
-
-
diff --git a/src/pages/auth/login.astro b/src/pages/auth/login.astro
index 06b10d13..808ac03d 100644
--- a/src/pages/auth/login.astro
+++ b/src/pages/auth/login.astro
@@ -9,7 +9,7 @@ if (valid) {
return Astro.redirect("/dashboard")
}
-const redirect = Astro.url.searchParams.get("redirect")
+const redirect = Astro.url.searchParams.get("r")
---
diff --git a/src/pages/auth/passwort-vergessen.astro b/src/pages/auth/passwort-vergessen.astro
index b46e6661..faf49ca4 100644
--- a/src/pages/auth/passwort-vergessen.astro
+++ b/src/pages/auth/passwort-vergessen.astro
@@ -5,11 +5,13 @@ import MinimalLayout from "#layouts/MinimalLayout.astro";
const valid = await validateAccessTokenServer(Astro)
+// Es kann sein, dass ein Nutzer von dem Ausweisformular kommt und sein Passwort vergessen hat.
+// In dem Fall sollte er auch auf das Formular zurückgeleitet werden wenn er sein Passwort zurückgesetzt hat.
+const redirect = Astro.url.searchParams.get("r")
+
if (valid) {
return Astro.redirect("/dashboard")
}
-
-const redirect = Astro.url.searchParams.get("redirect")
---
diff --git a/src/pages/auth/passwort-zuruecksetzen.astro b/src/pages/auth/passwort-zuruecksetzen.astro
index af8a2675..d75127b7 100644
--- a/src/pages/auth/passwort-zuruecksetzen.astro
+++ b/src/pages/auth/passwort-zuruecksetzen.astro
@@ -12,6 +12,7 @@ if (valid) {
}
const token = Astro.url.searchParams.get("t")
+const redirect = Astro.url.searchParams.get("r")
if (!token) {
return Astro.redirect("/")
@@ -25,5 +26,5 @@ if (!decoded.exp || decoded.exp < Date.now() || decoded.typ !== TokenType.Reset)
---
-
+
diff --git a/src/pages/auth/signup.astro b/src/pages/auth/signup.astro
index d8a797a5..a83a0a60 100644
--- a/src/pages/auth/signup.astro
+++ b/src/pages/auth/signup.astro
@@ -9,7 +9,7 @@ if (valid) {
return Astro.redirect("/dashboard")
}
-const redirect = Astro.url.searchParams.get("redirect");
+const redirect = Astro.url.searchParams.get("r");
---
diff --git a/src/pages/dashboard/objekte/index.astro b/src/pages/dashboard/objekte/index.astro
index 429ba1a1..8c341ca7 100644
--- a/src/pages/dashboard/objekte/index.astro
+++ b/src/pages/dashboard/objekte/index.astro
@@ -57,4 +57,5 @@ if (result.length > 0) {
return Astro.redirect("/dashboard/objekte/leer");
}
+
---
\ No newline at end of file
diff --git a/src/pages/energieausweis-erstellen/[ausweisart]/index.astro b/src/pages/energieausweis-erstellen/[ausweisart]/index.astro
index 23023b6c..e8b5174e 100644
--- a/src/pages/energieausweis-erstellen/[ausweisart]/index.astro
+++ b/src/pages/energieausweis-erstellen/[ausweisart]/index.astro
@@ -59,7 +59,7 @@ let loadFromDatabase = false;
if (typ === AusstellungsTyp.Neuausstellung) {
if (!user) {
- return Astro.redirect(`/auth/login?redirect=${Astro.url.toString()}`);
+ return Astro.redirect(`/auth/login?r=${Astro.url.toString()}`);
}
if (!ausweis_id) {
@@ -117,7 +117,7 @@ if (typ === AusstellungsTyp.Neuausstellung) {
loadFromDatabase = true;
} else if (typ === AusstellungsTyp.Speichern) {
if (!user) {
- return Astro.redirect(`/auth/login?redirect=${Astro.url.toString()}`);
+ return Astro.redirect(`/auth/login?r=${Astro.url.toString()}`);
}
if (!ausweis_id) {
@@ -154,7 +154,7 @@ if (typ === AusstellungsTyp.Neuausstellung) {
loadFromDatabase = true;
} else if (typ === AusstellungsTyp.Alternativdokument) {
if (!user) {
- return Astro.redirect(`/auth/login?redirect=${Astro.url.toString()}`);
+ return Astro.redirect(`/auth/login?r=${Astro.url.toString()}`);
}
if (!ausweis_id) {
diff --git a/src/pages/immowelt-old/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/index.astro b/src/pages/immowelt-old/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/index.astro
index 99de3256..ec4300d1 100644
--- a/src/pages/immowelt-old/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/index.astro
+++ b/src/pages/immowelt-old/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/index.astro
@@ -20,7 +20,7 @@ const caller = createCaller(Astro);
if (uid) {
if (!valid) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
diff --git a/src/pages/immowelt-old/angebot-anfragen/geg-nachweis-gewerbe-anfragen/index.astro b/src/pages/immowelt-old/angebot-anfragen/geg-nachweis-gewerbe-anfragen/index.astro
index fb57cda9..37a5b106 100644
--- a/src/pages/immowelt-old/angebot-anfragen/geg-nachweis-gewerbe-anfragen/index.astro
+++ b/src/pages/immowelt-old/angebot-anfragen/geg-nachweis-gewerbe-anfragen/index.astro
@@ -20,7 +20,7 @@ const caller = createCaller(Astro);
if (uid) {
if (!valid) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
diff --git a/src/pages/immowelt-old/angebot-anfragen/geg-nachweis-wohnen-anfragen/index.astro b/src/pages/immowelt-old/angebot-anfragen/geg-nachweis-wohnen-anfragen/index.astro
index 7afa9be9..24fcfb4a 100644
--- a/src/pages/immowelt-old/angebot-anfragen/geg-nachweis-wohnen-anfragen/index.astro
+++ b/src/pages/immowelt-old/angebot-anfragen/geg-nachweis-wohnen-anfragen/index.astro
@@ -23,7 +23,7 @@ const caller = createCaller(Astro);
if (uid) {
if (!valid) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
diff --git a/src/pages/immowelt-old/energieausweis-erstellen/bedarfsausweis-wohngebaeude/index.astro b/src/pages/immowelt-old/energieausweis-erstellen/bedarfsausweis-wohngebaeude/index.astro
index 96d1a944..b46e4216 100644
--- a/src/pages/immowelt-old/energieausweis-erstellen/bedarfsausweis-wohngebaeude/index.astro
+++ b/src/pages/immowelt-old/energieausweis-erstellen/bedarfsausweis-wohngebaeude/index.astro
@@ -19,7 +19,7 @@ const caller = createCaller(Astro);
if (uid) {
if (!valid) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
diff --git a/src/pages/immowelt-old/energieausweis-erstellen/verbrauchsausweis-gewerbe/index.astro b/src/pages/immowelt-old/energieausweis-erstellen/verbrauchsausweis-gewerbe/index.astro
index 7b7048eb..100f70df 100644
--- a/src/pages/immowelt-old/energieausweis-erstellen/verbrauchsausweis-gewerbe/index.astro
+++ b/src/pages/immowelt-old/energieausweis-erstellen/verbrauchsausweis-gewerbe/index.astro
@@ -23,7 +23,7 @@ const caller = createCaller(Astro);
if (uid) {
if (!valid) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}
diff --git a/src/pages/immowelt-old/energieausweis-erstellen/verbrauchsausweis-wohngebaeude/index.astro b/src/pages/immowelt-old/energieausweis-erstellen/verbrauchsausweis-wohngebaeude/index.astro
index fb4ff665..05765342 100644
--- a/src/pages/immowelt-old/energieausweis-erstellen/verbrauchsausweis-wohngebaeude/index.astro
+++ b/src/pages/immowelt-old/energieausweis-erstellen/verbrauchsausweis-wohngebaeude/index.astro
@@ -23,7 +23,7 @@ const caller = createCaller(Astro);
if (uid) {
if (!valid) {
return Astro.redirect(
- `/auth/login?redirect=${Astro.url.toString()}`
+ `/auth/login?r=${Astro.url.toString()}`
);
}