From b53ce04a75597bd165a3d4bd4277c8ae89cc21fc Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 23 Feb 2025 17:23:45 +0100 Subject: [PATCH] Remove reset password functionality --- astro-i18n.config.ts | 1 - src/components/ResetPasswordComponent.svelte | 81 -------------------- src/components/repo/authv2.ts | 16 +--- src/pages/passwort-zuruecksetzen.astro | 16 ---- 4 files changed, 3 insertions(+), 111 deletions(-) delete mode 100644 src/components/ResetPasswordComponent.svelte delete mode 100644 src/pages/passwort-zuruecksetzen.astro diff --git a/astro-i18n.config.ts b/astro-i18n.config.ts index 1ee359d..c1a4391 100644 --- a/astro-i18n.config.ts +++ b/astro-i18n.config.ts @@ -21,7 +21,6 @@ export default defineAstroI18nConfig({ statistiken: "stats", ankuendigungen: "announcements", datenschutzerklaerung: "privacy-policy", - "passwort-zuruecksetzen": "reset-password", "passwort-setzen": "set-password", }, }, diff --git a/src/components/ResetPasswordComponent.svelte b/src/components/ResetPasswordComponent.svelte deleted file mode 100644 index 64a645b..0000000 --- a/src/components/ResetPasswordComponent.svelte +++ /dev/null @@ -1,81 +0,0 @@ - - - - - -
-

{t("login.title")}

-
- - - - - - -
- - {#if error} -

{error}

- {/if} - -
- - \ No newline at end of file diff --git a/src/components/repo/authv2.ts b/src/components/repo/authv2.ts index 48564f5..57709fb 100644 --- a/src/components/repo/authv2.ts +++ b/src/components/repo/authv2.ts @@ -51,7 +51,7 @@ export class AuthV2Repo { } try { - const login = await this.request("/auth/state", { + const login = await this.request("/auth", { method: "POST", body: JSON.stringify({ name, @@ -68,22 +68,12 @@ export class AuthV2Repo { } } - async resetPassword(name: string, password: string, token: string) { - return await this.requestWithToken(token, "/auth/register", { - method: "POST", - body: JSON.stringify({ - name, - password, - }), - }); - } - async logout() { if (this.accessToken === undefined) { return; } - await this.request("/auth/state", { + await this.request("/auth", { method: "DELETE", }); @@ -142,7 +132,7 @@ export class AuthV2Repo { } try { - const response = await this.requestWithToken(this.refreshToken!, "/auth/state", { + const response = await this.requestWithToken(this.refreshToken!, "/auth", { method: "PUT", }).then(value => value.json()).then(value => AuthTokenSchema.parse(value)); diff --git a/src/pages/passwort-zuruecksetzen.astro b/src/pages/passwort-zuruecksetzen.astro deleted file mode 100644 index 719fc4c..0000000 --- a/src/pages/passwort-zuruecksetzen.astro +++ /dev/null @@ -1,16 +0,0 @@ ---- -import {t} from "astro-i18n"; -import BackgroundImage from "../components/BackgroundImage.astro"; -import ResetPasswordComponent from "../components/ResetPasswordComponent.svelte"; -import NavbarLayout from "../layouts/NavbarLayout.astro"; ---- - - -
- -
-
- -
-
\ No newline at end of file