diff --git a/apps/mobile/app/components/auth/change-password.tsx b/apps/mobile/app/components/auth/change-password.tsx
index 1fc7dd816..a3ca00938 100644
--- a/apps/mobile/app/components/auth/change-password.tsx
+++ b/apps/mobile/app/components/auth/change-password.tsx
@@ -73,7 +73,15 @@ export const ChangePassword = () => {
throw new Error(strings.backupFailed() + `: ${result.error}`);
}
- await db.user.changePassword(oldPassword.current, password.current);
+ const passwordChanged = await db.user.changePassword(
+ oldPassword.current,
+ password.current
+ );
+
+ if (!passwordChanged) {
+ throw new Error("Could not change user account password.");
+ }
+
ToastManager.show({
heading: strings.passwordChangedSuccessfully(),
type: "success",
diff --git a/apps/mobile/app/components/auth/forgot-password.tsx b/apps/mobile/app/components/auth/forgot-password.tsx
index 14e62a7ea..67f82e16e 100644
--- a/apps/mobile/app/components/auth/forgot-password.tsx
+++ b/apps/mobile/app/components/auth/forgot-password.tsx
@@ -19,7 +19,6 @@ along with this program. If not, see .
import React, { useRef, useState } from "react";
import { TextInput, View } from "react-native";
-import ActionSheet from "react-native-actions-sheet";
import { db } from "../../common/database";
import { DDS } from "../../services/device-detection";
import { ToastManager } from "../../services/event-manager";
@@ -35,9 +34,9 @@ import Paragraph from "../ui/typography/paragraph";
import { strings } from "@notesnook/intl";
import { DefaultAppStyles } from "../../utils/styles";
-export const ForgotPassword = () => {
+export const ForgotPassword = ({ userEmail }: { userEmail: string }) => {
const { colors } = useThemeColors("sheet");
- const email = useRef(undefined);
+ const email = useRef(userEmail);
const emailInputRef = useRef(null);
const [error, setError] = useState(false);
const [loading, setLoading] = useState(false);
@@ -87,94 +86,76 @@ export const ForgotPassword = () => {
return (
<>
- (email.current = data)}
- onClose={() => {
- setSent(false);
- setLoading(false);
- }}
- onOpen={() => {
- emailInputRef.current?.setNativeProps({
- text: email.current
- });
- }}
- indicatorStyle={{
- width: 100
- }}
- gestureEnabled
- id="forgotpassword_sheet"
- >
- {sent ? (
-
+
+ {strings.recoveryEmailSent()}
+
-
- {strings.recoveryEmailSent()}
-
- {strings.recoveryEmailSentDesc()}
-
-
- ) : (
-
+
+ ) : (
+
+
+
+
+ {
+ email.current = value;
}}
- >
-
-
+ defaultValue={email.current}
+ onErrorCheck={(e) => setError(e)}
+ returnKeyLabel={strings.next()}
+ returnKeyType="next"
+ autoComplete="email"
+ validationType="email"
+ autoCorrect={false}
+ autoCapitalize="none"
+ errorMessage={strings.emailInvalid()}
+ placeholder={strings.email()}
+ onSubmit={() => {}}
+ />
- {
- email.current = value;
- }}
- defaultValue={email.current}
- onErrorCheck={(e) => setError(e)}
- returnKeyLabel={strings.next()}
- returnKeyType="next"
- autoComplete="email"
- validationType="email"
- autoCorrect={false}
- autoCapitalize="none"
- errorMessage={strings.emailInvalid()}
- placeholder={strings.email()}
- onSubmit={() => {}}
- />
-
-
-
- )}
-
+
+
+ )}
>
);
};
diff --git a/apps/mobile/app/components/auth/login.tsx b/apps/mobile/app/components/auth/login.tsx
index a9f869267..5fb5b72b8 100644
--- a/apps/mobile/app/components/auth/login.tsx
+++ b/apps/mobile/app/components/auth/login.tsx
@@ -25,7 +25,11 @@ import { TouchableOpacity, View, useWindowDimensions } from "react-native";
import { SheetManager } from "react-native-actions-sheet";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import { DDS } from "../../services/device-detection";
-import { eSendEvent, ToastManager } from "../../services/event-manager";
+import {
+ eSendEvent,
+ presentSheet,
+ ToastManager
+} from "../../services/event-manager";
import Navigation from "../../services/navigation";
import PremiumService from "../../services/premium";
import SettingsService from "../../services/settings";
@@ -110,7 +114,6 @@ export const Login = ({
return (
<>
-
{
- ToastManager.show({
- type: "info",
- message:
- "Password changing has been disabled temporarily to address some issues faced by users. It will be enabled again once the issues have resolved."
+ if (loading || !email.current) return;
+ presentSheet({
+ component:
});
- // if (loading || !email.current) return;
- // SheetManager.show("forgotpassword_sheet");
}}
textStyle={{
textDecorationLine: "underline"
diff --git a/apps/mobile/app/components/auth/session-expired.tsx b/apps/mobile/app/components/auth/session-expired.tsx
index f6df8a902..360f8153e 100644
--- a/apps/mobile/app/components/auth/session-expired.tsx
+++ b/apps/mobile/app/components/auth/session-expired.tsx
@@ -97,7 +97,7 @@ export const SessionExpired = () => {
if (db.tokenManager._isTokenExpired(res))
throw new Error("token expired");
- const key = await db.user.getEncryptionKey();
+ const key = await db.user.getDataEncryptionKeys();
if (!key) throw new Error("No encryption key found.");
Sync.run("global", false, "full", async (complete) => {
diff --git a/apps/mobile/app/components/paywall/index.tsx b/apps/mobile/app/components/paywall/index.tsx
index 8a7d7b624..c4bea39b2 100644
--- a/apps/mobile/app/components/paywall/index.tsx
+++ b/apps/mobile/app/components/paywall/index.tsx
@@ -182,6 +182,7 @@ const PayWall = (props: NavigationProps<"PayWall">) => {
>
{
Navigation.replace("FluidPanelsView", {});
}}
diff --git a/apps/mobile/app/components/sheets/recovery-key/index.jsx b/apps/mobile/app/components/sheets/recovery-key/index.jsx
index 45f5dd2b5..7b0825d0e 100644
--- a/apps/mobile/app/components/sheets/recovery-key/index.jsx
+++ b/apps/mobile/app/components/sheets/recovery-key/index.jsx
@@ -169,7 +169,7 @@ class RecoveryKeySheet extends React.Component {
};
onOpen = async () => {
- let k = await db.user.getEncryptionKey();
+ let k = await db.user.getMasterKey();
this.user = await db.user.getUser();
if (k) {
this.setState({
diff --git a/apps/mobile/app/screens/settings/settings-data.tsx b/apps/mobile/app/screens/settings/settings-data.tsx
index 34a506918..bbf2e4d70 100644
--- a/apps/mobile/app/screens/settings/settings-data.tsx
+++ b/apps/mobile/app/screens/settings/settings-data.tsx
@@ -331,17 +331,10 @@ export const settingsGroups: SettingSection[] = [
{
id: "change-password",
name: strings.changePassword(),
- // type: "screen",
+ type: "screen",
description: strings.changePasswordDesc(),
- // component: "change-password",
- icon: "form-textbox-password",
- modifer: () => {
- ToastManager.show({
- type: "info",
- message:
- "Password changing has been disabled temporarily to address some issues faced by users. It will be enabled again once the issues have resolved."
- });
- }
+ component: "change-password",
+ icon: "form-textbox-password"
},
{
id: "change-email",
diff --git a/apps/mobile/package-lock.json b/apps/mobile/package-lock.json
index 9409d3e6a..d84a50ee0 100644
--- a/apps/mobile/package-lock.json
+++ b/apps/mobile/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@notesnook/mobile",
- "version": "3.3.13-beta.1",
+ "version": "3.3.13",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@notesnook/mobile",
- "version": "3.3.13-beta.1",
+ "version": "3.3.13",
"hasInstallScript": true,
"license": "GPL-3.0-or-later",
"dependencies": {