Skip to content

Commit

Permalink
mobile: ask user to save recovery key after changing password
Browse files Browse the repository at this point in the history
  • Loading branch information
ammarahm-ed committed Mar 6, 2024
1 parent 9b72890 commit 6e7b7ce
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions apps/mobile/app/components/auth/change-password.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ import {
ToastEvent
} from "../../services/event-manager";
import { useUserStore } from "../../stores/use-user-store";
import { eCloseSheet } from "../../utils/events";
import { eCloseSheet, eOpenRecoveryKeyDialog } from "../../utils/events";
import DialogHeader from "../dialog/dialog-header";
import { Button } from "../ui/button";
import Input from "../ui/input";
import { Notice } from "../ui/notice";
import Seperator from "../ui/seperator";
import { Dialog } from "../dialog";
import BackupService from "../../services/backup";
import { sleep } from "../../utils/time";

export const ChangePassword = () => {
const passwordInputRef = useRef();
Expand Down Expand Up @@ -78,6 +79,8 @@ export const ChangePassword = () => {
});
setLoading(false);
eSendEvent(eCloseSheet);
await sleep(300);
eSendEvent(eOpenRecoveryKeyDialog);
} catch (e) {
setLoading(false);
ToastEvent.show({
Expand Down Expand Up @@ -135,7 +138,14 @@ export const ChangePassword = () => {
/>

<Notice
text="Changing password is a non-undoable process. You will be logged out from all your devices. Please make sure you do not close the app while your password is changing and have good internet connection."
text={`Changing password is an irreversible process. You will be logged out from all your devices. Please make sure you do not close the app while your password is changing and have good internet connection.`}
type="alert"
/>

<View style={{ height: 10 }} />

<Notice
text={`Once your password is changed, please make sure to save the new account recovery key.`}
type="alert"
/>

Expand Down

0 comments on commit 6e7b7ce

Please sign in to comment.