-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
49 additions
and
11 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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<script lang="ts"> | ||
import { Button, Card, Input, P } from "flowbite-svelte"; | ||
import { axios } from "$lib"; | ||
let form: HTMLFormElement; | ||
async function handleSubmit() { | ||
const formData = new FormData(form); | ||
const email = formData.get("email") as string; | ||
try { | ||
await axios.post("/password_reset/", { email }); | ||
alert("Password reset link sent to your email"); | ||
} catch (error) { | ||
alert("An error occurred. Please try again later."); | ||
} | ||
} | ||
</script> | ||
<div class="container flex"> | ||
<div class="mx-auto container"> | ||
<h1 class="text-3xl font-semibold text-center mt-8 inline-block"> Password</h1> | ||
<Card> | ||
<P>Enter your email address and we will send you a link to reset your password.</P> | ||
<form class="center mt-4" bind:this={form} on:submit|preventDefault={handleSubmit}> | ||
<Input class="mb-4" type="email" label="Email" name="email" /> | ||
<Button class="ml-auto" type="submit">Submit</Button> | ||
</form> | ||
</Card> | ||
</div> | ||
</div> |