-
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
20 changed files
with
274 additions
and
115 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export const SESSION_DATA_KEY = 'sessionDataKey'; | ||
export const SETUP_KEY = 'setupKey'; | ||
export const SETUP_PASSWORD = 'setupPassword'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<script lang="ts"> | ||
import { goto } from '$app/navigation'; | ||
import { Button, SetupContainer, Title } from '$components'; | ||
import { sessionStorageQueries } from '$queries'; | ||
import { dismissWindow } from '$helpers'; | ||
import InputPassword from '$components/InputPassword.svelte'; | ||
const { changePasswordWithDeviceKeyMutation } = sessionStorageQueries(); | ||
let oldPassword = ''; | ||
let confirmPassword = ''; | ||
let password = ''; | ||
$: charCount = password.length; | ||
$: isDisabled = charCount < 8 || confirmPassword !== password || oldPassword === ''; | ||
</script> | ||
|
||
<SetupContainer> | ||
<button class="self-start ml-6 mb-4 flex items-center" on:click={dismissWindow}> | ||
<img src="/img/arrow-left.svg" alt="Arrow" /> | ||
<span class="ml-2 text-base">Back</span></button | ||
> | ||
<Title>Manage Password</Title> | ||
{#if $changePasswordWithDeviceKeyMutation.error} | ||
<span class="text-xs text-alert">{$changePasswordWithDeviceKeyMutation.error.message}</span> | ||
{/if} | ||
<div class="p-6 w-full"> | ||
<InputPassword bind:value={oldPassword} label="Old Password" extraProps="mb-6" /> | ||
<InputPassword | ||
bind:value={password} | ||
label="New Password (8 Characters min)" | ||
extraProps="mb-6" | ||
error={charCount < 8 ? 'Please enter a minimum of 8 Characters' : ''} | ||
/> | ||
<InputPassword | ||
bind:value={confirmPassword} | ||
label="Confirm New Password" | ||
extraProps="mb-4" | ||
error={confirmPassword !== password ? "Password doesn't Match" : ''} | ||
/> | ||
</div> | ||
|
||
<div class="grid grid-cols-2 gap-5 w-full p-6"> | ||
<Button label="Cancel" onClick={dismissWindow} color="secondary" /> | ||
<Button | ||
disabled={isDisabled} | ||
label="Update password" | ||
onClick={() => | ||
$changePasswordWithDeviceKeyMutation.mutate( | ||
{ | ||
newPassword: password, | ||
oldPassword: oldPassword | ||
}, | ||
{ | ||
onSuccess: () => { | ||
goto('/setup-keys/done'); | ||
} | ||
} | ||
)} | ||
/> | ||
</div> | ||
</SetupContainer> |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
<script lang="ts"> | ||
import { SetupContainer } from '$components'; | ||
</script> | ||
|
||
<SetupContainer> | ||
<slot /> | ||
</SetupContainer> |
Oops, something went wrong.