-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from seanmorley15/development
Development
- Loading branch information
Showing
8 changed files
with
123 additions
and
92 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
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
71 changes: 47 additions & 24 deletions
71
frontend/src/routes/settings/forgot-password/confirm/+page.svelte
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 |
---|---|---|
@@ -1,35 +1,58 @@ | ||
<script lang="ts"> | ||
import { enhance } from '$app/forms'; | ||
import { goto } from '$app/navigation'; | ||
import { page } from '$app/stores'; | ||
import type { PageData } from './$types'; | ||
export let data: PageData; | ||
</script> | ||
|
||
<h1 class="text-center font-bold text-4xl mb-4">Change Password</h1> | ||
<form action="?/reset" method="post" use:enhance> | ||
<input type="hidden" name="uid" value={data.props.uid} /> | ||
<input type="hidden" name="token" value={data.props.token} /> | ||
<div class="flex items-center justify-center gap-4"> | ||
<input | ||
type="password" | ||
class="input input-bordered w-full max-w-xs" | ||
id="new_password1" | ||
name="new_password1" | ||
placeholder="New Password" | ||
/> | ||
<input | ||
type="password" | ||
class="input input-bordered w-full max-w-xs" | ||
id="new_password2" | ||
name="new_password2" | ||
placeholder="Confirm Password" | ||
/> | ||
<button type="submit" class="btn btn-primary"> Submit </button> | ||
{#if $page.form?.message} | ||
<div class="text-center text-error mt-4"> | ||
{$page.form?.message} | ||
|
||
{#if data.props.token && data.props.uid} | ||
<p class="text-center">You will then be redirected to the login page.</p> | ||
<div | ||
class="modal-action items-center" | ||
style="display: flex; flex-direction: column; align-items: center; width: 100%;" | ||
> | ||
<form action="?/reset" method="post" use:enhance> | ||
<input type="hidden" name="uid" value={data.props.uid} /> | ||
<input type="hidden" name="token" value={data.props.token} /> | ||
|
||
<div class="mb-2 w-full"> | ||
<input | ||
type="password" | ||
class="input input-bordered w-full" | ||
id="new_password1" | ||
name="new_password1" | ||
placeholder="New Password" | ||
/> | ||
</div> | ||
<div class="mb-2 w-full"> | ||
<input | ||
type="password" | ||
class="input input-bordered w-full" | ||
id="new_password2" | ||
name="new_password2" | ||
placeholder="Confirm Password" | ||
/> | ||
</div> | ||
{/if} | ||
<button type="submit" class="btn btn-primary w-full">Submit</button> | ||
{#if $page.form?.message} | ||
<div class="text-center text-error mt-4"> | ||
{$page.form?.message} | ||
</div> | ||
{/if} | ||
</form> | ||
</div> | ||
{:else} | ||
<div class="flex justify-center"> | ||
<div class="items-center justify-center"> | ||
<p class="text-center">Token and UID are required for password reset.</p> | ||
|
||
<button class="btn btn-neutral" on:click={() => goto('/settings/forgot-password')}> | ||
Reset Password | ||
</button> | ||
</div> | ||
</div> | ||
</form> | ||
{/if} |